Java way to quickly find if a point hits a country (polygon)

I hope someone can point me in the right direction.

We have millions of records that flow / flows, where we need to quickly see which polygon of the country they fall into.

Can anyone recommend a complete JAVA approach for this. From what can I say that I will use JTS and / or geotools? My thoughts are to take all the polygons of the country and possibly separate them using FishNet or Grid to make them smaller to increase productivity. Then I loaded them into a spatial index in a java-based database ... As the stream of records through I would do a search in the index of java spaces to see which country they were in. (Perhaps as a collection of spatial functions).

Is this approach suitable for a lot of data? From a java point of view, how would I implement this? Is it just using JTS and / or Geotools? What type of index would I create. (The polygon data will be static after loading, as it will simply contain the borders of the country)

From reading the geotools documentation, it's hard to decipher the spatial index and how well does it work and should it be used?

Any help or guidance would be appreciated.

thank

+3
source share
2 answers

The problem you are trying to solve is called a problem in the training ground . A previous answer provided an example of testing if one point is in the same polygon using JTS (Java Topology Suite).

, . , , distance .

+3

: - O (log n), n - .

: 6 : , , , ,

+1

All Articles