Skip to content

Instantly share code, notes, and snippets.

@aborruso
Last active October 3, 2018 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aborruso/eaf54571b22d36e96e9cee28197cc822 to your computer and use it in GitHub Desktop.
Save aborruso/eaf54571b22d36e96e9cee28197cc822 to your computer and use it in GitHub Desktop.

Modalità 1

Requisiti

curl -sL "https://harrywood.co.uk/maps/examples/openlayers/display-osm/display-osm.osm" | xml2json | \
jq -r '.osm.node[]|{id,lat,lon,user}| map(.) | @csv' | sed 's/"//g'

output

358802885,34.0666735,-118.734254,yellowbkpk
453966480,34.07234,-118.7343501,Apo42
453966482,34.0670965,-118.7322253,Apo42
453966143,34.0724577,-118.7364799,Apo42
453966130,34.0671122,-118.7364725,Apo42
453966490,34.0722227,-118.7322321,Apo42

Modalità 2

Requisiti

curl -sL "https://harrywood.co.uk/maps/examples/openlayers/display-osm/display-osm.osm" | \
xmlstarlet sel -T -t -m "osm/node" -v "concat(@id,',',@lat,',',@lon,',',@lon,',',@user)" -n

output

358802885,34.0666735,-118.734254,-118.734254,yellowbkpk
453966480,34.07234,-118.7343501,-118.7343501,Apo42
453966482,34.0670965,-118.7322253,-118.7322253,Apo42
453966143,34.0724577,-118.7364799,-118.7364799,Apo42
453966130,34.0671122,-118.7364725,-118.7364725,Apo42
453966490,34.0722227,-118.7322321,-118.7322321,Apo42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment