From be7daedfb2ddb1df8ca017a8b3b2991fed567ae1 Mon Sep 17 00:00:00 2001 From: lukasmartinelli Date: Tue, 28 Jun 2016 09:16:29 +0200 Subject: [PATCH] Move subdivide into import-osm --- docker-compose.yml | 1 - src/import-osm/import.sh | 10 ++++++++++ src/{import-sql => import-osm}/subdivide_polygons.sql | 0 src/import-sql/prepare.sh | 7 ------- 4 files changed, 10 insertions(+), 8 deletions(-) rename src/{import-sql => import-osm}/subdivide_polygons.sql (100%) diff --git a/docker-compose.yml b/docker-compose.yml index f81e261..e52962b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -135,7 +135,6 @@ import-sql: - postgis:db environment: SQL_CREATE_INDIZES: 'false' - SQL_SUBDIVIDE_POLYGON: 'true' mapbox-studio: image: "osm2vectortiles/mapbox-studio" volumes: diff --git a/src/import-osm/import.sh b/src/import-osm/import.sh index 7845a89..f7cc13c 100644 --- a/src/import-osm/import.sh +++ b/src/import-osm/import.sh @@ -56,6 +56,9 @@ function import_pbf() { echo "Update osm_place_polygon with point geometry" update_points + echo "Subdividing polygons in $OSM_DB" + subdivide_polygons + echo "Update scaleranks from Natural Earth data" update_scaleranks @@ -80,6 +83,10 @@ function create_osm_water_point_table() { exec_sql_file "water_point_table.sql" } +function subdivide_polygons() { + exec_sql_file "subdivide_polygons.sql" +} + function update_scaleranks() { exec_sql_file "update_scaleranks.sql" } @@ -189,6 +196,9 @@ function import_pbf_diffs() { echo "Update osm_place_polygon with point geometry" update_points + echo "Subdividing polygons in $OSM_DB" + subdivide_polygons + local timestamp=$(extract_timestamp "$diffs_file") echo "Set $timestamp for latest updates from $diffs_file" update_timestamp "$timestamp" diff --git a/src/import-sql/subdivide_polygons.sql b/src/import-osm/subdivide_polygons.sql similarity index 100% rename from src/import-sql/subdivide_polygons.sql rename to src/import-osm/subdivide_polygons.sql diff --git a/src/import-sql/prepare.sh b/src/import-sql/prepare.sh index 5dff39f..8d87dd6 100755 --- a/src/import-sql/prepare.sh +++ b/src/import-sql/prepare.sh @@ -26,13 +26,6 @@ function exec_sql_file() { } function main() { - if [ "$SQL_SUBDIVIDE_POLYGON" = true ] ; then - echo "Subdividing polygons in $OSM_DB" - exec_sql_file "$SQL_SUBDIVIDE_POLYGON_FILE" - else - echo "Omitting subdividing polygons for $OSM_DB" - fi - echo "Creating functions in $OSM_DB" exec_sql_file "$SQL_FUNCTIONS_FILE" exec_sql_file "$SQL_XYZ_EXTENT_FILE"