tile38 icon indicating copy to clipboard operation
tile38 copied to clipboard

Detect object inside or outside a area?

Open anhtu91 opened this issue 6 years ago • 6 comments

Hi, I would like to say many thanks to your contribution. But I have a question: How can I detect a object inside or outside a area? This area i have already define like this:

http://test-server.ikt.fh-dortmund.de:9851/ SET fhDortmund_1 fhDO_1 OBJECT {"type":"Polygon","coordinates":[[[51.506664, 7.455623],[51.505856, 7.455644],[51.505823, 7.456031],[51.506658, 7.456149],[51.506664, 7.455623]]]}

and

http://test-server.ikt.fh-dortmund.de:9851/ SET fhDortmund_2 fhDO_2 OBJECT {"type":"Polygon","coordinates":[[[51.506658, 7.456149],[51.505636, 7.456009],[51.505482, 7.458111],[51.506491, 7.458272],[51.506658, 7.456149]]]}

I have tried to use NEARBY command but it is always "loading"

http://test-server.ikt.fh-dortmund.de:9851/NEARBY fhDortmund_1 FENCE ROAM fhDortmund_1 * 5000

Have anyone any idea? Thanks in advance.

anhtu91 avatar Apr 25 '19 15:04 anhtu91

TEST GET fhDortmund_2 fhDO_2 WITHIN GET fhDortmund_1 fhDO_1

docs: https://tile38.com/commands/test/

rshura avatar Apr 26 '19 16:04 rshura

TEST GET fhDortmund_2 fhDO_2 WITHIN GET fhDortmund_1 fhDO_1

docs: https://tile38.com/commands/test/

Hi, thanks for your help. But i still have a question: How can I dectect a point if it is nearby another point. I have thought about using NEARBY command but don't know how it work. Can you please give me some examples? I really appreciate your help.

anhtu91 avatar Apr 29 '19 11:04 anhtu91

I guess I didn't understand the question. Do you want to compute a distance between two known points? Or do you want to search around one point to find others?

rshura avatar Apr 29 '19 15:04 rshura

I guess I didn't understand the question. Do you want to compute a distance between two known points? Or do you want to search around one point to find others?

Hi, I want to search if I am near one point. For example, I am searching for a coffee shop and when I am near the coffee shop, it should push me a notification.

anhtu91 avatar Apr 30 '19 13:04 anhtu91

So how do you decide what's near? Is 1m near? 1km? 100km? 1000km?

If you want to search for things within a given radius, use this: WITHIN key CIRCLE lat lon meters to get all the objects stored in a key that are within a given circle.

Or, you can do NEARBY key POINT lat lon to get all objects stored in a key, starting from closest to lat,lon and ordered by distance.

rshura avatar Apr 30 '19 23:04 rshura

Thank you very much

anhtu91 avatar May 20 '19 09:05 anhtu91