Created
September 21, 2016 16:38
-
-
Save zimmicz/169c109c3e9f2a39ff9dde90e1602f30 to your computer and use it in GitHub Desktop.
OSM2PostGIS
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 | |
wget http://download.geofabrik.de/europe/czech-republic-latest-free.shp.zip | |
unzip czech-republic-latest-free.shp.zip -d osm | |
cd osm | |
rename 's/gis\.//g' *.* | |
rename 's/osm_//g' *.* | |
rename 's/_free_1//g' *.* | |
export PG_USE_COPY=YES | |
for f in ./*.shp; do | |
echo "Loading $f..." | |
ogr2ogr -f "PostgreSQL" PG:"dbname=munigtc user=zimmi active_schema=osm" \ | |
-s_srs EPSG:4326 \ | |
-t_srs EPSG:5514 \ | |
-lco GEOMETRY_NAME=geom \ | |
-nlt PROMOTE_TO_MULTI \ | |
-gt 65000 \ | |
$f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment