-
Notifications
You must be signed in to change notification settings - Fork 45
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
Adding overpass_trim() for filtering by area in overpass #258
base: main
Are you sure you want to change the base?
Conversation
Are you still open to work on this? I'm interested in the functionality and I can help in the implementation. Any feedback from the contributors would be useful. |
@jmaspons yes, i am very keen for something to happen with this - it's already been open way too long, which ain't good 😱 I should also be able to allocate some time to this soon too, but please feel free to see what you can do in the meantime. It's an important idea. |
@mpadge Would you be able to provide any feedback on the code/changes proposed? There were deeper modifications in the underlaying code and would be good to know your opinion if this is even in the right direction. |
Yeah, for sure @Mashin6, and great that you responded so promptly after such a long time - thank you! I'll get back to asap - hopefully in a few days when i find some time to look through it. Thanks! |
@jmaspons Did you have some ideas for implementing the overpass-side area trimming? |
My idea is to pass a string in the form Then, a |
I like the simplicity of it. Would definitely like to see how it turns out. |
@Mashin6 There've been a few changes to |
You can find a working implementation at #286 |
This PR addresses suggestion #256.
Main changes are:
overpass_trim()
that modifies OP query to subset OSM features by area rather than currently default bbox. Function parses entered information about areas to be used for trimming and stores them in a list inoverpass_query
object:trim_area = list (ways = c(ID, ... ), relations = c(ID, ...)
opq_string_intern()
was modified to accommodate changes necessary for area filtering.ftype
was introduced inopq_string_intern
that allows easy switching of which object types are queried. This can be easily extended to more types when [FEATURE] Limit queries to specific feature types #257 would be implemented.nwr[...];
if (is.null (bbox))
from functions:opq()
,add_osm_feature()
,add_osm_features()
and introduced final check at the beginning ofopq_string_intern
. This was to allowopq()
to be called withoutgetbb()
. So the queries can be now built like this:or
The only thing I am not happy about is that a typical user would expect trimming to work like this instead:
But that would require making
bbox_to_string
return object id and type along with its bbox and letopq
sort it out into$bbox
and$trim_area
. Any ideas?