Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nearby objects within a polygon #665

Open
jafitzwater opened this issue Nov 29, 2022 · 8 comments
Open

nearby objects within a polygon #665

jafitzwater opened this issue Nov 29, 2022 · 8 comments

Comments

@jafitzwater
Copy link

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!

@iwpnd
Copy link
Contributor

iwpnd commented Dec 2, 2022

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?

@jafitzwater
Copy link
Author

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%

@tidwall
Copy link
Owner

tidwall commented Dec 8, 2022

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

@iwpnd
Copy link
Contributor

iwpnd commented Dec 8, 2022

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

@joefitzwater
Copy link

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

@tidwall
Copy link
Owner

tidwall commented Dec 22, 2022

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

@jafitzwater
Copy link
Author

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

@jafitzwater
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants