Coder Social home page Coder Social logo

[RFC] Add geospatial filter about carto-react HOT 4 CLOSED

Clebal avatar Clebal commented on September 23, 2024
[RFC] Add geospatial filter

from carto-react.

Comments (4)

borja-munoz avatar borja-munoz commented on September 23, 2024 1

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.

VictorVelarde avatar VictorVelarde commented on September 23, 2024

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.

borja-munoz avatar borja-munoz commented on September 23, 2024

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.

Clebal avatar Clebal commented on September 23, 2024

Implementation has began in #226.

from carto-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.