tidwall / tile38

Real-time Geospatial and Geofencing
https://tile38.com
MIT License
9.15k stars 570 forks source link

Get geoObjects from cache, which contains (not contained in) some polygon #461

Open stavavram opened 5 years ago

stavavram commented 5 years ago

Hi, I need to check which polygons in my cache contain some other polygon. I saw that 'within' command return only objects that are fully contained inside of a specified bounding area. It's the opposite case.

Maybe i can use the 'Intersects' command and check the overlap percentage, but I don't know if such ability exists in tile38.

rshura commented 5 years ago

You can first, as you suggested, find ids of all things that intersect with your polygon of interest p, and then call

TEST GET collection p_id WITHIN GET collection id

for each id returned by INTERSECTS. If p is not in the same collection, you can specify it directly. See https://tile38.com/commands/test/ for details.