Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
273 lines (236 sloc) 33.2 KB
#This script imports each osm.pbf file into a postgis database and creates extracts. Afterwards, the tables are dropped.
#Don't forget to set the passwords for the database user
#Run this script as osmdata user
# mapping.yml file is provided
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_building.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/building_EPSG4326.gpkg -nln building_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where building <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/building_EPSG4326.gpkg -nln building_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where building <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/building_EPSG4326.gpkg -nln building_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where building <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_highway.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/highway_EPSG4326.gpkg -nln highway_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where highway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/highway_EPSG4326.gpkg -nln highway_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where highway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/highway_EPSG4326.gpkg -nln highway_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where highway <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_natural.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where \"natural\" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where \"natural\" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where \"natural\" <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_address.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/address_EPSG4326.gpkg -nln address_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where \"addr\" <> '' or \"addr:housenumber\" <> '' or \"addr:housename\" <> '' or \"addr:flats\" <> '' or \"addr:conscriptionnumber\" <> '' or \"addr:street\" <> '' or \"addr:place\" <> '' or \"addr:postcode\" <> '' or \"addr:city\" <> '' or \"addr:country\" <> '' or \"addr:full\" <> '' or \"addr:hamlet\" <> '' or \"addr:suburb\" <> '' or \"addr:subdistrict\" <> '' or \"addr:district\" <> '' or \"addr:province\" <> '' or \"addr:state\" <> '' or \"addr:interpolation\" <> '' or \"addr:inclusion\" <> '' or \"addr:door\" <> '' or \"addr:unit\" <> '' or \"addr:floor\" <> '' or \"addr:block\" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/address_EPSG4326.gpkg -nln address_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where \"addr\" <> '' or \"addr:housenumber\" <> '' or \"addr:housename\" <> '' or \"addr:flats\" <> '' or \"addr:conscriptionnumber\" <> '' or \"addr:street\" <> '' or \"addr:place\" <> '' or \"addr:postcode\" <> '' or \"addr:city\" <> '' or \"addr:country\" <> '' or \"addr:full\" <> '' or \"addr:hamlet\" <> '' or \"addr:suburb\" <> '' or \"addr:subdistrict\" <> '' or \"addr:district\" <> '' or \"addr:province\" <> '' or \"addr:state\" <> '' or \"addr:interpolation\" <> '' or \"addr:inclusion\" <> '' or \"addr:door\" <> '' or \"addr:unit\" <> '' or \"addr:floor\" <> '' or \"addr:block\" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/address_EPSG4326.gpkg -nln address_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where \"addr\" <> '' or \"addr:housenumber\" <> '' or \"addr:housename\" <> '' or \"addr:flats\" <> '' or \"addr:conscriptionnumber\" <> '' or \"addr:street\" <> '' or \"addr:place\" <> '' or \"addr:postcode\" <> '' or \"addr:city\" <> '' or \"addr:country\" <> '' or \"addr:full\" <> '' or \"addr:hamlet\" <> '' or \"addr:suburb\" <> '' or \"addr:subdistrict\" <> '' or \"addr:district\" <> '' or \"addr:province\" <> '' or \"addr:state\" <> '' or \"addr:interpolation\" <> '' or \"addr:inclusion\" <> '' or \"addr:door\" <> '' or \"addr:unit\" <> '' or \"addr:floor\" <> '' or \"addr:block\" <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_landuse.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/landuse_EPSG4326.gpkg -nln landuse_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where landuse <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/landuse_EPSG4326.gpkg -nln landuse_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where landuse <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/landuse_EPSG4326.gpkg -nln landuse_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where landuse <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_waterway.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/waterway_EPSG4326.gpkg -nln waterway_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where waterway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/waterway_EPSG4326.gpkg -nln waterway_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where waterway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/waterway_EPSG4326.gpkg -nln waterway_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where waterway <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_boundary.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/boundary_EPSG4326.gpkg -nln boundary_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where boundary <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/boundary_EPSG4326.gpkg -nln boundary_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where boundary <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/boundary_EPSG4326.gpkg -nln boundary_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where boundary <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_route.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/route_EPSG4326.gpkg -nln route_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where route <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/route_EPSG4326.gpkg -nln route_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where route <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/route_EPSG4326.gpkg -nln route_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where route <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_amenity.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/amenity_EPSG4326.gpkg -nln amenity_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where amenity <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/amenity_EPSG4326.gpkg -nln amenity_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where amenity <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/amenity_EPSG4326.gpkg -nln amenity_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where amenity <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_place.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/place_EPSG4326.gpkg -nln place_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where place <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/place_EPSG4326.gpkg -nln place_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where place <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/place_EPSG4326.gpkg -nln place_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where place <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_leisure.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/leisure_EPSG4326.gpkg -nln leisure_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where leisure <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/leisure_EPSG4326.gpkg -nln leisure_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where leisure <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/leisure_EPSG4326.gpkg -nln leisure_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where leisure <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_water.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/water_EPSG4326.gpkg -nln water_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where water <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/water_EPSG4326.gpkg -nln water_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where water <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/water_EPSG4326.gpkg -nln water_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where water <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_power.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/power_EPSG4326.gpkg -nln power_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where power <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/power_EPSG4326.gpkg -nln power_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where power <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/power_EPSG4326.gpkg -nln power_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where power <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_barrier.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/barrier_EPSG4326.gpkg -nln barrier_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where barrier <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/barrier_EPSG4326.gpkg -nln barrier_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where barrier <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/barrier_EPSG4326.gpkg -nln barrier_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where barrier <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_railway.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/railway_EPSG4326.gpkg -nln railway_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where railway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/railway_EPSG4326.gpkg -nln railway_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where railway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/railway_EPSG4326.gpkg -nln railway_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where railway <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_man_made.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/man_made_EPSG4326.gpkg -nln man_made_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where man_made <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/man_made_EPSG4326.gpkg -nln man_made_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where man_made <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/man_made_EPSG4326.gpkg -nln man_made_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where man_made <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_shop.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/shop_EPSG4326.gpkg -nln shop_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where shop <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/shop_EPSG4326.gpkg -nln shop_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where shop <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/shop_EPSG4326.gpkg -nln shop_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where shop <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_sport.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/sport_EPSG4326.gpkg -nln sport_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where sport <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/sport_EPSG4326.gpkg -nln sport_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where sport <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/sport_EPSG4326.gpkg -nln sport_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where sport <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_tourism.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/tourism_EPSG4326.gpkg -nln tourism_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where tourism <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/tourism_EPSG4326.gpkg -nln tourism_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where tourism <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/tourism_EPSG4326.gpkg -nln tourism_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where tourism <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_public_transport.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/public_transport_EPSG4326.gpkg -nln public_transport_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where public_transport <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/public_transport_EPSG4326.gpkg -nln public_transport_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where public_transport <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/public_transport_EPSG4326.gpkg -nln public_transport_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where public_transport <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_historic.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/historic_EPSG4326.gpkg -nln historic_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where historic <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/historic_EPSG4326.gpkg -nln historic_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where historic <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/historic_EPSG4326.gpkg -nln historic_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where historic <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_emergency.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/emergency_EPSG4326.gpkg -nln emergency_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where emergency <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/emergency_EPSG4326.gpkg -nln emergency_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where emergency <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/emergency_EPSG4326.gpkg -nln emergency_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where emergency <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_office.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/office_EPSG4326.gpkg -nln office_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where office <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/office_EPSG4326.gpkg -nln office_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where office <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/office_EPSG4326.gpkg -nln office_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where office <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_aeroway.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/aeroway_EPSG4326.gpkg -nln aeroway_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where aeroway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/aeroway_EPSG4326.gpkg -nln aeroway_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where aeroway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/aeroway_EPSG4326.gpkg -nln aeroway_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where aeroway <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_craft.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/craft_EPSG4326.gpkg -nln craft_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where craft <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/craft_EPSG4326.gpkg -nln craft_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where craft <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/craft_EPSG4326.gpkg -nln craft_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where craft <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_military.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/military_EPSG4326.gpkg -nln military_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where military <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/military_EPSG4326.gpkg -nln military_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where military <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/military_EPSG4326.gpkg -nln military_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where military <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_aerialway.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/aerialway_EPSG4326.gpkg -nln aerialway_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where aerialway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/aerialway_EPSG4326.gpkg -nln aerialway_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where aerialway <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/aerialway_EPSG4326.gpkg -nln aerialway_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where aerialway <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_geological.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/geological_EPSG4326.gpkg -nln geological_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where geological <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/geological_EPSG4326.gpkg -nln geological_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where geological <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/geological_EPSG4326.gpkg -nln geological_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where geological <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
cd /home/osmdata/pbf/
./imposm import -mapping mapping.yml -cachedir /home/osmdata/impcache -overwritecache -srid 4326 -write -connection postgis://postgres:*******@localhost/osmdatabase -read planet-latest_telecom.osm.pbf
ogr2ogr -f "GPKG" /home/osmdata/gpkg/telecom_EPSG4326.gpkg -nln telecom_EPSG4326_point -nlt POINT PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_point where telecom <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/telecom_EPSG4326.gpkg -nln telecom_EPSG4326_line -nlt LINESTRING -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_linestring where telecom <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/telecom_EPSG4326.gpkg -nln telecom_EPSG4326_polygon -nlt POLYGON -update PG:"host=localhost dbname=osmdatabase user=postgres password=postgres" -sql "select * from import.osm_polygon where telecom <> ''"
psql -d osmdatabase -c "DROP TABLE import.osm_point"
psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"
You can’t perform that action at this time.