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.
Testing a point against a million polygons will take a lot of time, no matter how efficient your point is in a polygon function.
. , .
, . , , , , , , . , , , .
, - R-tree , , .
, ( O(log(n))), "--" , .
O(log(n))
, R-.
, .
, - , , , .
? :
.
:
: cell_x, cell_y, polygon_id. ( cell_x cell_y)
cell_x
cell_y
polygon_id
, , 10 , .
, , , , , 5 .