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

Load only specific features based on an overpass query #747

Open
planemad opened this issue Feb 12, 2016 · 3 comments
Open

Load only specific features based on an overpass query #747

planemad opened this issue Feb 12, 2016 · 3 comments

Comments

@planemad
Copy link

It is getting harder to use TM in areas where there is a high density of data, an example is the project to add turn lanes in Los Angeles. Even with the XS task size, the API times out.

A solution might be for TM to only load certain features via an overpass query into JOSM that is relevant for the project. For example this query will return only the major roads that are relevant to the turn lanes mapping.

This not only allows loading of data from larger areas, but significantly makes the task simpler for a mapper by reducing distractions.

How it would work
The project setting can have an extra text box to accept a compact Overpass Query exported from Overpass Turbo like [out:json][timeout:25];(way["highway"]["highway"!="unclassified"]["highway"!="residential"]["highway"!="service"]["highway"!="footway"](33.88908500017752,-118.4007740020752,33.93616801078204,-118.32833290100098););out body;>;out skel qt; for the example above.

When a user clicks edit in JOSM, TM will have to query overpass for the task bbox and load the results into JOSM via remote control.

It would be great to hear from others on use cases for a feature like this. Sadly it would not benefit users of iD.

@ethan-nelson
Copy link
Collaborator

I personally foresee issues of people struggling with adding the syntax correctly and breaking overpass turbo links for all tasks on a project, but I may just be a little too cautious about it. It could potentially be implemented by adding a field on the project edit page that allows for additional custom overpass turbo search criteria. Alternatively, the current link could take users to the overpass turbo main page with the standard query added but not actually run. That would then give people the opportunity to customize the query as they see fit.

@openbrian
Copy link

I did a fair bit of work on this last night and may have a PR soon.

@openbrian
Copy link

So, got this working. It's not as impressive as I'd thought, as it will /load_and_zoom JOSM with some data as it does normally, then /import from the Overpass API using the stored query. But it loads data in the current data set, not a new one. So it appears to be just merging the data. There doesn't appear to be an /import_in_new_layer command.

Since this is data you will likely want to edit, maybe it's better to skip the /load_and_zoom, if there's an overpass query. I didn't want to change any of that without guidance. I'll submit my PR for a code review and feedback.

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

No branches or pull requests

4 participants