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

[On Hold] Store Overpass queries on OpenStreetMap.org #18

Open
wtimme opened this issue Jan 1, 2020 · 2 comments
Open

[On Hold] Store Overpass queries on OpenStreetMap.org #18

wtimme opened this issue Jan 1, 2020 · 2 comments
Labels
overpass The Overpass API is a read-only API that serves up custom selected parts of the OSM map data

Comments

@wtimme
Copy link
Owner

wtimme commented Jan 1, 2020

This is an idea from @tordans (see #13):

Apparently there is an API for the user profile on osm.org which allows to store app specific data which is not used a lot, but Overpass might use it for its "save on osm.org". If so, this could be used to load the same queries in the app

The endpoint he is referring to is /api/0.6/user/preferences.

When saving the queries from overpass turbo, they are available in the XML. Example:

<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
    <preferences>
        <preference k="overpass-ide_query_0_0" v="p=2&n=Trees with `ref` in Berlin&q=LyoKVGhpcyBoYcSGYmVlbiBnxI1lcmF0ZWQgYnkgdGhlIG92xJJwxIlzLXR1cmJvIHdpemFyZC7EgsSdxJ9yaWdpbmFsIHNlxLBjaMSsxIk6CsOiwoDCnMS7xKfEk2w9dHLEjCBhbsSXxZFmIMSFIG5vdMWbdWzEvcWUxJd0eXBlOsWcZGXFiMKdCiovCltvdXQ6anNvbl1bdGltZcW0xbYyNV07"/>
        <preference k="overpass-ide_query-count" v="1"/>
    </preferences>
</osm>
@tordans tordans mentioned this issue Jan 2, 2020
@tordans
Copy link

tordans commented Jan 2, 2020

Do you have an idea what format this q query param has?

Looking at the code that writes those preferences at https://github.com/tyrasd/overpass-turbo/blob/master/js/sync-with-osm.js to me (with my limited coding knowledge) it looks like this file does not transform this q-values, it just loads it. This might be a place that decodes the query(?) https://github.com/tyrasd/overpass-turbo/blob/master/js/ide.js#L1412

We could ask tyrasd about it, if this is something that will really help the app. But I am a unsure …

  • overpass can do a lot of special stuff in queries that do not fit this use case - like "out center" and length calculations and colour css and other. I am pretty sure quite a few of those result sets will to be formatted in a way that can be displayed in the app. So maybe there would be a lot of edgecase or filtering to be done?
  • the UI on the overpass-turbo-website is not optimized for this usecase (saving queries for external us), so it would not increase the usability for this app a lot. There is still the need for an edit UI or at least a help UI that explains how to create and save queries in overpass turbo.

@wtimme wtimme added the overpass The Overpass API is a read-only API that serves up custom selected parts of the OSM map data label Jan 3, 2020
@wtimme
Copy link
Owner Author

wtimme commented Jan 3, 2020

Thanks for your concerns! Yes, that looks like the place. From what I can tell, the string seems to be encoded with Base64. lzw_decode seems to refer to a compression called Lempel–Ziv–Welch.

the UI on the overpass-turbo-website is not optimized for this usecase (saving queries for external us), so it would not increase the usability for this app a lot.

That's correct; I actually wasn't aware of this functionality until you pointed it out. I don't think the app should primarily use the OSM preferences as the storage backend. However, I think incorporating the exchange of queries between Overpass Turbo and OSM Completionist is something that we can do for sure, as just another form of data source.

There is still the need for an edit UI

100% agreed. At the moment, the UI is an MVP at best.

To summarize, I think we can keep this GitHub issue, but we don't need to rush to it. If someone has the time and wants to look into it, I'm happy about contributions.

@wtimme wtimme changed the title Store Overpass queries on OpenStreetMap.org [On Hold] Store Overpass queries on OpenStreetMap.org Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
overpass The Overpass API is a read-only API that serves up custom selected parts of the OSM map data
Projects
None yet
Development

No branches or pull requests

2 participants