Giter Site home page Giter Site logo

Effective overlap query about s2geometry HOT 3 CLOSED

google avatar google commented on August 20, 2024
Effective overlap query

from s2geometry.

Comments (3)

jmr avatar jmr commented on August 20, 2024

You say overlap query, but you seem to be describing a point containment query. Maybe I'm just not familiar with the terminology.

Does S2ContainsPointQuery do what you want? Look at s2contains_point_query_test.cc for example uses.

Do all of your polygons fit in memory?

from s2geometry.

benstadin avatar benstadin commented on August 20, 2024

Thanks for the link. I think the test case starting at line 107 is what I'm looking for.

Yes, the polygons should all fit into memory. I want to create static set of regions from polygons of varying shape (will always be regular simple type polygons), and test if a moving location coordinate (position) is inside on of the indexed fences. Indexed regions may also overlap each other sometimes.

What is the Big O for the query round about?

By overlap I mean an intersection test, which also includes the border of the indexed polygon and not only tests if it's contained within. It is important for me that the intersection test between the original defined polygon region and position coordinate is exact.

from s2geometry.

jmr avatar jmr commented on August 20, 2024

What is the Big O for the query round about?

You can think of it as O(log(num_shapes)).

It is important for me that the intersection test between the original defined polygon region and position coordinate is exact.

I'm not sure of the exact guarantees, but you don't have the input geometry exactly, and the conversion from lat/lng to S2Point also isn't exact, so maybe rethink this.

from s2geometry.

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.