OpenStreetMap 로고 OpenStreetMap

Hiking relations in wiki table

Cascafico님이 Italian (Italiano)로 2018년 12월 10일에 게시함.

Intro

When adding several hiking routes, sometime it comes handy having updated tables in wiki format to be easily added in specific wiki pages.

Recipe

  • overpass query on area name
  • some awk insertions
  • pyhon script csv2wiki

overpass-query

This overpass query will generate a csv file(ie: stregna.csv) with local network hiking paths. Example output:

@id,name,ref,network
2071931,,747,lwn
6934010,Sentiero Italia - Tappa A14,SI,lwn
7112799,Sentiero Hum,,lwn

This awk will add OSM link to each relation:
$ awk -F “,” ‘FNR == 1 {print $0} FNR > 1 { print “[osm.org/relation/”$1” “$1”],”$2”,”$3”,”$4 }’ stregna.csv > stregna.txt

actual wiki formatting

Python script will generate the actual wiki text:
$ python csv2wiki stregna.txt > stregna.wiki

summarizing script

This script performs the steps above (here you can customize query with whatever relation tags). Just provide an OSM area name.

이메일 아이콘 Bluesky 아이콘 Facebook 아이콘 LinkedIn 아이콘 마스토돈 아이콘 텔레그램 아이콘 X 아이콘

토론

2018년 12월 10일 17:24ikonor님의 의견

Thanks for sharing.

I always thought that it would be nice to replace those routes wiki tables with dynamically generated ones in HTML/JavaScript.

There was an attempt to add a table tab to Overpass Turbo, but unfortunately didn’t complete.

Or a dedicated web page that can list relations of a given type for a specific area, e.g. using DataTables or similar, and maybe show a map next to it. Completion percentage could be calculated from the distance tag and the actual length of the way members.

2018년 12월 11일 22:55qwerty22님의 의견

Thanks for sharing. It is very useful for me.

댓글을 남기려면 로그인하세요