Fast algorithm for finding thousands of points in millions of polygons?

I tried to find out thousands of points in a million polygon through web services. At first I implemented the (Point in polygon) algorithm in java, but it takes a lot of time. Then I split the table in mysql and tried using multiple threads to solve it, but still inefficient. Is there a faster algorithm or implementation to solve this problem?

Plus a description of the polygon. 2D, static, complex polygon (also with a hole).

Any suggestion would be appreciated.

+3
source share
4 answers

Testing a point against a million polygons will take a lot of time, no matter how efficient your point is in a polygon function.

. , .

, . , , , , , , . , , , .

+3

, - R-tree , , .

, ( O(log(n))), "--" , .

, R-.

, .

+3

, - , , , .

? :

  • 2D? 3D?
  • ? , ?
  • ?
  • ? ? ? ? ? ?

, .

.

, .

:

  • ,
  • .

: cell_x, cell_y, polygon_id. ( cell_x cell_y)

, , 10 , .

:

  • , .
  • ,

, .

+1

, , , , , 5 .

0

All Articles