Skip to content

Instantly share code, notes, and snippets.

@arbakker
Created August 5, 2020 15:02
Show Gist options
  • Save arbakker/a1e2e1db33885f71f3f8a1b87075554e to your computer and use it in GitHub Desktop.
Save arbakker/a1e2e1db33885f71f3f8a1b87075554e to your computer and use it in GitHub Desktop.
extract poi's from OSM
#!/usr/bin/env bash
areas=( europe/germany/schleswig-holstein-latest.osm.pbf europe/germany/niedersachsen-latest.osm.pbf europe/denmark-latest.osm.pbf )
for area in "${areas[@]}"
do
echo "processing: $area"
url="https://download.geofabrik.de/$area"
pbf_file=$(basename $area)
if [ ! -f "$pbf_file" ]; then
echo "$url"
curl "$url" -o "$pbf_file"
fi
ogr2ogr -append -f GPKG campsites.gpkg -skipfailures -sql "select * from points where other_tags LIKE '%\"tourism\"=>\"camp_site\"%'" -nln campsites "$pbf_file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment