Created
July 17, 2019 04:34
-
-
Save Dante383/bf5c3678795fa0ccc2b6afa01c40f7ce to your computer and use it in GitHub Desktop.
OSM: get all street names with coordinates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -eq 0 || $# -eq 1 ]] ; then | |
echo 'Usage: ./get_streets.sh input_file.osm output_file.csv' | |
exit 0 | |
fi | |
# convert .osm to .o5m | |
osmconvert $1 -o=temp.o5m | |
osmfilter temp.o5m --keep="highway=residential =primary =secondary =tertiaty=unclassified" --drop-author --drop-version > temp.osm | |
rm temp.o5m | |
osmconvert temp.osm --all-to-nodes --csv="@lat @lon name" --csv-headline > temp.csv | |
rm temp.osm | |
awk '$3!=""' temp.csv > $2 | |
rm temp.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment