OSM GPX extractor for non experts
ߊ߬ ߟߊߦߟߍ߬ߣߍ߲߬ ߦߋ߫ pangoSE ߓߟߏ߫ 13 February 2020 ߦߋ߫ English ߟߋ߬ ߘߐ߫ ߟߊ߬ߞߎ߬ߘߦߊ߬ߟߌ߬ ߞߐߟߕߊ 23 June 2020 ߘߐ߫Hi. During my engagement in swedish hiking groups I became aware of the need for a service for extracting GPX-files with huts and shelters to put into GPS-devices and phones.
I built a simple website to fill this need which was a fun and learning experience :)
Try it out here: https://pangose.github.io/gpx-extractor/ Code: https://github.com/pangoSE/gpx-extractor
Discussion
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ mmd ߟߊ߫ 13 February 2020 at 21:27 ߘߐ߫
I believe one of your example queries does not return any geometry information for ways, i.e. you’re probably missing out a few thousand objects. Maybe try this one here: https://overpass-turbo.eu/s/QHD
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ pangoSE ߟߊ߫ 14 February 2020 at 10:03 ߘߐ߫
Hi mmd, which query do you mean?
This is the function that builds the query: function buildQuery(areaCode) { var q = ‘https://overpass-api.de/api/interpreter?data=[out:xml][timeout:325];area(‘+areaCode+’)->.searchArea;’+query+’out;’;
I decided not to add “center” after out because it does not seem to be necessary and make the query time much longer. togpx() handles the data like this: “Points are converted to Waypoints. Lines are converted to Tracks. (Multi)Polygons are represented as a Track of their outline(s).” see https://github.com/tyrasd/togpx
I don’t know how this looks on a GPS-device because I don’t own one.
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ mmd ߟߊ߫ 14 February 2020 at 10:10 ߘߐ߫
Query was the second one “huts, shelters, shalets, … “. In your query you use “nwr” which returns nodes, ways, and relations. However, for the ways, you only receive the “node ids”, not the actual nodes with lat/lon details.
togpx cannot create anything meaningful in this case, as there’s simply no geoemtry available. Please compare:
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ H@mlet ߟߊ߫ 14 February 2020 at 12:33 ߘߐ߫
When I search for “Brittany”, it finds Q327, which is the historical entity and has no OSM relation ID, as it doesn’t exists anymore.
The correct result would be Q12130 which has the correct relation ID.
Regards.
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ H@mlet ߟߊ߫ 14 February 2020 at 12:39 ߘߐ߫
Otherwise it worked quite well with area “ Sweden “, with Firefox mobile 68.5.0 and osmand.
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ pangoSE ߟߊ߫ 14 February 2020 at 20:57 ߘߐ߫
Hi Hamlet. Have a look on WP:Brittany. It says: “This article is about the cultural region in the north-west of France. For the current French administrative region, see Brittany (administrative region).”
So in this case “Brittany (administrative region)” should work in your case as it is linked with Q12130.
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ pangoSE ߟߊ߫ 14 February 2020 at 20:58 ߘߐ߫
@mmd Thank you! Now I understand. I will add center to all queries then. :)
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ H@mlet ߟߊ߫ 14 February 2020 at 23:01 ߘߐ߫
Right, it’s a bit cumbersome, but it works ! :-)
You might want to add some kind of completion, looking for wikidata items with OSM IDs, because when I tried, your tool asked me to change the first item, which was confusing.
Anyway thanks for your tool. You could add a “water” section, I like to have drinking_water, toilets and such highlighted on my maps.
Regards.
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ pangoSE ߟߊ߫ 16 February 2020 at 10:59 ߘߐ߫
I now added jQuery Autocomplete from the Wikipedia API. I’m quite happy with the result! :)
ߡߙߌߣߊ߲ ߞߊ߬ ߝߘߊ߫ pangoSE ߟߊ߫ 19 February 2020 at 22:06 ߘߐ߫
Code is now at https://github.com/pangoSE/gpx-extractor MIT license. Feel free to create issues with ideas for improvements or bugs.