Comments (4)
I understand the input argument is a GeoJSON feature and, when the filter is applied, only the features in the source intersecting with that input feature are considered. It should work like any other filter by applying some condition to the source features, in this case a spatial intersection.
from carto-react.
I'm ok with adding an extra spatial filter if it's useful... I'm just not 100% sure if we should stick here to the simple / most used use: 1 geojson polygon + intersection or maybe consider something wider in terms of api interface, like for example allowing 1 circle + distance (like we did in carto.js) for typical buffer analysis or even considering more operators beyond intersection.
We're currently just dealing with client-side calculations, so my guess is that this 'spatial filter' would be limited to the portion of the viewport the user sees right?, so if a portion of that new polygon is outside of the viewport, that wouldn't be considered... right?. If we enter server-side that (and also other aspects would need to change).
from carto-react.
For now I will restrict the feature to intersecting the features with a single geojson feature. The circle/buffer case is interesting but the user can generate the buffer geometry using Turf.js or the SQL API. We are going to implement something similar in the feature selection tool.
We will work just with viewport features. It is just another filter we add, so all the existing filters apply (including the implicit viewport filter). If we have add support for "global" widgets in the future, it will be easy for geojson sources and not so easy for vector tiles as it will require queries to the backend.
from carto-react.
Implementation has began in #226.
from carto-react.
Related Issues (20)
- FormulaWidget issue with mode global disabled HOT 14
- [RFC] Add a territory selector widget HOT 3
- [RFC] Save custom geometries created with the SpatialFilter HOT 2
- [RFC] Support for Drop a Pin HOT 3
- [RFC] Support for multi-language HOT 3
- [RFC] Comparative Widgets HOT 5
- [RFC] Save the state of the filters HOT 3
- [RFC] Spatial Filter HOT 11
- GeoJSON support in useCartoLayerProps HOT 1
- queryParameters HOT 7
- Remote executeModel doesn't work for POST requests HOT 4
- quadbinZoom error HOT 2
- Hygen is not working HOT 3
- [RFC] Widget size control HOT 1
- [RFC] Export AnimatedNumber component HOT 1
- [Bug] BarWidgetUI
- [RFC] Site Selection - Information element for widgets
- executeSQL function doesn't return the status error
- Allow passing decimal precision as a prop for CategoryWidgetUI HOT 4
- [Bug] ComparativeCategoryWidgetUI progress bar missing background color
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carto-react.