Skip to content
Permalink
Browse files

Update 04_imposm2postgis_gpkg_extract

  • Loading branch information...
michaelmgis committed Aug 30, 2019
1 parent bb1f576 commit e8b05e5bd36ffb9e2f0d41c07c66c41962eb55ef
Showing with 6 additions and 6 deletions.
  1. +6 −6 Version_2_imposm3/04_imposm2postgis_gpkg_extract
@@ -20,18 +20,18 @@ psql -d osmdatabase -c "DROP TABLE import.osm_linestring"
psql -d osmdatabase -c "DROP TABLE import.osm_polygon"

./imposm3 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 PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_point where "natural" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_line -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_linestring where "natural" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_polygon -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_polygon where "natural" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_point PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_point where \"natural\" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_line -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_linestring where \"natural\" <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/natural_EPSG4326.gpkg -nln natural_EPSG4326_polygon -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -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"


./imposm3 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 PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_point where 'addr' <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/address_EPSG4326.gpkg -nln address_EPSG4326_line -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_linestring where 'addr' <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/address_EPSG4326.gpkg -nln address_EPSG4326_polygon -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -sql "select * from import.osm_polygon where 'addr' <> ''"
ogr2ogr -f "GPKG" /home/osmdata/gpkg/address_EPSG4326.gpkg -nln address_EPSG4326_point PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -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 -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -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 -update PG:"host=localhost dbname=osmdatabase user=postgres password=**************" -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"

0 comments on commit e8b05e5

Please sign in to comment.
You can’t perform that action at this time.