From 60eb6af803de48e847dbe8dca475cb783e4f857b Mon Sep 17 00:00:00 2001
From: Nikolaus Krismer <nikolaus.krismer@uibk.ac.at>
Date: Wed, 4 Nov 2015 13:41:53 +0100
Subject: [PATCH] added support for chaging srid and fixed problem with
 exported datasets (did not contain density)

---
 CHANGELOG.md            |  1 +
 bootstrap/importData.sh | 13 ++++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07fc773..c1c8bc3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 Upcoming version:
 -----------------
+  - added support for chaging srid and fixed problem with exported datasets (did not contain density) (Nikolaus Krismer)
   - always installing phpliteadmin when using spatialite now (Nikolaus Krismer)
   - fixed problems with filenames in config (Nikolaus Krismer)
   - merged (Nikolaus Krismer)
diff --git a/bootstrap/importData.sh b/bootstrap/importData.sh
index 09b9c2d..430988e 100755
--- a/bootstrap/importData.sh
+++ b/bootstrap/importData.sh
@@ -57,6 +57,7 @@ OSM_FILE_SALZBURG_FILTERED="salzburg-140301-filtered.osm"
 OSM_FILE_SANFRANCISCO_FILTERED="sanfrancisco-140301-filtered.osm"
 OSM_FILE_TRENTOALTOADIGE_FILTERED="southtyrol-140301-filtered.osm"
 OSM_KEYS="aerialway,highway,public_transport,railway,route"
+TARGET_SRID="3857"
 
 ############################
 # Function definitions     #
@@ -122,19 +123,21 @@ function fn_import_dataset_postgis() {
 	if $AVAILABLE_ISOCHRONE_DATAMODEL && [ ! -f "$DATA_DIR/$SQL_EXPORT_FILE" ]; then
 		echo "  - creating datamodel using isochrone-datamodel"
 		# Create datamodel using isochrone-datamodel project
-		DB_USERNAME="$PG_DB_USER" DB_PASSWORD="$PG_DB_PASSWORD" "$DEPLOY_DIR/isochrone-datamodel/builder.sh" -d -s -b -l -t -c${CITY} >> "$WORKING_DIR/create_datamodel_$CITY.log" 2>&1
+		DB_USERNAME="$PG_DB_USER" DB_PASSWORD="$PG_DB_PASSWORD" "$DEPLOY_DIR/isochrone-datamodel/builder.sh" -d -s -b -l -t${TARGET_SRID} -c${CITY} >> "$WORKING_DIR/create_datamodel_$CITY.log" 2>&1
 
 		echo "  - copying tables to isochrone database"
 		PGPASSWORD="spatial" pg_dump -U spatial -h localhost -p 5432 -x -O -d spatial -t "transformed.${CITY}_*"  | sed -e "s/transformed/public/g" | PGPASSWORD="$PG_DB_PASSWORD" psql -h localhost  -U "$PG_DB_USER" -p 5432 -d isochrone >> "$WORKING_DIR/create_datamodel_$CITY.log" 2>&1
-
-		# Exporting resulting database to $DATA_DIR
-		echo "  - exporting database dump for ${CITY}"
-		PGPASSWORD="$PG_DB_PASSWORD" pg_dump -U "$PG_DB_USER" -h localhost -p 5432 -d isochrone --clean --compress=5 --if-exists -t "${CITY}_*" --file="$DATA_DIR/$SQL_EXPORT_FILE" >> "$WORKING_DIR/create_datamodel_$CITY.log" 2>&1
 	fi
 
 	if $AVAILABLE_POSTGIS && $AVAILABLE_ISOCHRONE_TOOLS; then
 		java -cp $DOWNLOAD_DIR/isochrone-tools.jar at.uibk.dbis.isochrone.generator.density.DensityGenerator -t "$CITY" -d 60,120,180,240,300 >> "$WORKING_DIR/create_datamodel_$CITY.log" 2>&1
 	fi
+
+	if $AVAILABLE_ISOCHRONE_DATAMODEL; then
+		# Exporting resulting database to $DATA_DIR
+		echo "  - exporting database dump for ${CITY}"
+		PGPASSWORD="$PG_DB_PASSWORD" pg_dump -U "$PG_DB_USER" -h localhost -p 5432 -d isochrone --clean --compress=5 --if-exists -t "${CITY}_*" --file="$DATA_DIR/$SQL_EXPORT_FILE" >> "$WORKING_DIR/create_datamodel_$CITY.log" 2>&1
+	fi
 }
 
 function fn_init_geoserver() {
-- 
GitLab