tile38 icon indicating copy to clipboard operation
tile38 copied to clipboard

nearby objects within a polygon

Open jafitzwater opened this issue 1 year ago • 8 comments

I have been attempting to do a query where I am searching within a polygon for the closest N number of objects to a specific point.

Currently, i have to do a within, and extend the search limit to a super high number, then run a custom functioning to find nearby, however this takes quite a long time.

Thoughts on this? thanks in advance!

jafitzwater avatar Nov 29 '22 18:11 jafitzwater

Hi @jafitzwater

you already noticed that this does not work right now out of the box. A NEARBY search is currently limited to either no boundary, or a search radius (circle). If you'd wish NEARBY to only consider your input polygon, somebody would have to extend the NEARBY command here.

If this is something you'd consider @tidwall I'd be happy to give it a shot?

iwpnd avatar Dec 02 '22 07:12 iwpnd

Yes, this is exactly what im thinking, would love to utilize this in some of the projects. I'm sure there has to be others that would utilize this too. Seems like a option that should be included 100%

jafitzwater avatar Dec 05 '22 15:12 jafitzwater

@iwpnd What do you think the syntax would look like?

tidwall avatar Dec 08 '22 11:12 tidwall

hmm 🤔

NEARBY fleet POINT 33.462 -112.268 OBJECT {}

But that looks confusing, given the syntax of the other searches. It would also be hell for existing clients.

edit: NEARBY fleet POINT 33.462 -112.268 FROM OBJECT {} NEARBY fleet POINT 33.462 -112.268 FROM CIRCLE 33.462 -112.268 1000

more concise, but would also annoy existing clients

iwpnd avatar Dec 08 '22 13:12 iwpnd

What are the thoughts on this? thanks for considering it!

joefitzwater avatar Dec 20 '22 15:12 joefitzwater

Perhaps we just add a new option to the NEARBY that works similar to the LIMIT option, but for a geometry. Similar to the FROM that @iwpnd suggested but maybe more client friendly.

NEARBY fleet LIMIT_WITHIN geom  POINT 33.464 -112.268
NEARBY fleet LWITHIN geom  POINT 33.464 -112.268

tidwall avatar Dec 22 '22 14:12 tidwall

Happy new year! Just checking on any additional thoughts on this if its something that can happen still?

jafitzwater avatar Jan 06 '23 15:01 jafitzwater

NEARBY fleet LIMIT_WITHIN geom POINT 33.464 -112.268 NEARBY fleet LWITHIN geom POINT 33.464 -112.268 These options seem like they would work and as you stated seem very client friendly, any thoughts on the integration of this option?

jafitzwater avatar May 11 '23 20:05 jafitzwater