OpenHistoricalMap / issues

File your issues here, regardless of repo until we get all our repos squared away; we don't want to miss anything.
Creative Commons Zero v1.0 Universal
19 stars 1 forks source link

Customize Overpass turbo example queries #814

Closed 1ec5 closed 5 months ago

1ec5 commented 5 months ago

Overpass turbo comes with a set of seven example queries, accessible via the Load button in the toolbar, that are fairly OpenStreetMap-specific. At the same time, I see users get stuck on how to filter by date, which is such a basic task for OpenHistoricalMap but not very intuitive to someone just learning OverpassQL. We should replace the examples with ones that are more relevant to OHM workflows while keeping them basic enough to serve as pedagogical tools. Some of these examples on the wiki are good candidates for this UI.

The examples are defined here, before getting automatically converted from Overpass XML to OverpassQL:

https://github.com/OpenHistoricalMap/overpass-turbo/blob/43d1d9aa7e8bbb7152c89354900fdd327f9f7ffe/js/settings.js#L212-L235

Equivalent wizard syntax is defined here:

https://github.com/OpenHistoricalMap/overpass-turbo/blob/43d1d9aa7e8bbb7152c89354900fdd327f9f7ffe/js/settings.js#L290-L308

Other parts of the same file name and describe the queries.

erictheise commented 5 months ago

If we're going to do this right, @1ec5, we should eliminate as much mystery/magic as we can.

In the oldest building example, how would a user find that Ohio has relation(id:2663622)?

erictheise commented 5 months ago

The first three example queries are live on the site. It's likely you'll need to clear localStorage to see them.

In Chrome dev tools, select the Application tab. At left, find the Storage section, expand Local Storage, then right-click and Clear.

1ec5 commented 5 months ago

In the oldest building example, how would a user find that Ohio has relation(id:2663622)?

There’s a couple ways to do it, such as {{geocodeArea:Ohio}} (if Nominatim were in better shape), or area["name"="Ohio"] (if we could get rid of the dates inside name).

Anyhow, I didn’t meant to say that the examples on the wiki are polished enough to go in the UI – feel free to tweak them as needed for clarity.

erictheise commented 5 months ago

@Rub21, thanks for getting the front end code up at https://overpass-turbo-staging.openhistoricalmap.org/. I'm getting an Ajax Error modal in the browser–

image

-and am getting a Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID error in the console that's associated with an incorrect URL: overpass-api.staging.openhistoricalmap.org/api/interpreter.

1ec5 commented 5 months ago

In case we want to make the “Oldest building in Ohio” example more transparent:

// Get present-day Ohio as an area.
area["name"="Ohio"][!"end_date"]->.ohio;

I didn’t demonstrate this approach on the wiki page, because way too many boundary relations still have date ranges stuffed into their names: #793.

erictheise commented 5 months ago

@1ec5, this is ready for testing at https://overpass-turbo-staging.openhistoricalmap.org/. With the caveats about finding Ohio above I punted on expanding the comments.

erictheise commented 5 months ago

Ha; simultaneous posts.

1ec5 commented 5 months ago

I renamed the “Chronology relations” example to “Chronology relations with boundary geometries” so users can figure out what it’s about without reading the full description.