You are not logged in.
- Topics: Active | Unanswered
Announcement
#1 2022-06-16 05:27:59
- Mishari
- Moderator
- Registered: 2013-01-14
- Posts: 189
How to extract context for places in Overpass
Hi,
As part of our effort to add Bahasa Melayu languages to the 3 Southern border provinces I'm preparing an overpass query to extract out places to put in a CSV file using the following query (link):
[out:csv(::id, ::type, place, name, official_name, "name:th", "name:mfa", "name:mfa-Arab", "name:mfa-Latn", "name:mfa-Thai")];
// fetch area “Pattani” to search in
(
{{geocodeArea:Pattani}};
{{geocodeArea:Yala}};
{{geocodeArea:Narathiwat}};
)->.searchArea;
// gather results
(
// query part for: “place=*”
node["place"](area.searchArea);
way["place"](area.searchArea);
);
// print results
out meta;/*fixed by auto repair*/
>;
out meta qt;/*fixed by auto repair*/
The issue with this is that some village names are not unique and the volunteer translators don't know what we're talking about, so I would like to provide some context. One idea is to use the guide in https://wiki.openstreetmap.org/wiki/Ove … ls_to_POIs to add some context, another is to make the node id clickable links to OSM so people can see for themselves. Ideally we may use both methods, however with the geocoding one I've faced a problem where the query runs for a very long time and abruptly stops working. Does anyone know how to make it work or recommend alternatives?
(cross posted from Users:Thailand)
Best Regards
Mishari
Offline
#2 2022-06-16 10:20:03
- mmd
- Member
- Registered: 2010-11-06
- Posts: 2,101
Re: How to extract context for places in Overpass
The wiki page you've quoted uses the "is_in" statement to find out which areas your node is in. Due to a bug, this statement results in an endless loop for some of your nodes (in particular https://www.openstreetmap.org/node/1192389996).
I've created the following bug report: https://github.com/drolbr/Overpass-API/issues/670
Last edited by mmd (2022-06-16 10:21:05)
Offline
#3 2022-06-17 17:26:35
- mmd
- Member
- Registered: 2010-11-06
- Posts: 2,101
Re: How to extract context for places in Overpass
I tried this now on an instance, where the bug no longer occurs using the following query https://overpass-turbo.eu/s/1jqr
To make validating the results a bit easier for you, I have uploaded an XML version here: https://gist.github.com/mmd-osm/ad3bedf … 7eabc52d1d
Does that look ok to you?
Last edited by mmd (2022-06-17 17:28:40)
Offline
#4 2022-06-20 03:54:09
- Mishari
- Moderator
- Registered: 2013-01-14
- Posts: 189
Re: How to extract context for places in Overpass
This is a great starting point for me, thank you
Offline