OpenStreetMap標誌 OpenStreetMap

電郵圖示 Bluesky圖示 Facebook圖示 LinkedIn圖示 Mastodon圖示 Telegram圖示 X圖示

討論

mmd2020年2月13日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

pangoSE2020年2月14日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.

mmd2020年2月14日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:

  • way(34996405)[tourism=chalet];out;
  • way(34996405)[tourism=chalet];out center;

H@mlet2020年2月14日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@mlet2020年2月14日12:39發表的評論

Otherwise it worked quite well with area “ Sweden “, with Firefox mobile 68.5.0 and osmand.

pangoSE2020年2月14日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.

pangoSE2020年2月14日20:58發表的評論

@mmd Thank you! Now I understand. I will add center to all queries then. :)

H@mlet2020年2月14日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.

pangoSE2020年2月16日10:59發表的評論

I now added jQuery Autocomplete from the Wikipedia API. I’m quite happy with the result! :)

pangoSE2020年2月19日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.

登入以留言