-4

I have to store a set of 2D polygons in memory (less than 1000) in a structure which allows to find efficiently the ones containing a point. Polygons never change and contain about 10 points.

I have to launch the query about 10000 times per second.

I guess a structure using quad trees or similar and bounding boxes of the polygons would do this as I need.

Does anybody know a free java library offering this service ?

mvera
  • 904
  • 12
  • 23

1 Answers1

0

I don't think there's such a service, but as a structure you can use https://docs.oracle.com/javase/8/docs/api/java/awt/Polygon.html. You even have a method to check for point inclusion.

Adrian Ber
  • 20,474
  • 12
  • 67
  • 117