tile38
tile38 copied to clipboard
nearby objects within a polygon
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!
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?
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%
@iwpnd What do you think the syntax would look like?
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
What are the thoughts on this? thanks for considering it!
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
Happy new year! Just checking on any additional thoughts on this if its something that can happen still?
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?