diff --git a/etc/vagrant/bootstrap.sh b/etc/vagrant/bootstrap.sh index ccb500cf66269c7d2976c60ae76cd65daeeda47c..2939cb8bc5d40b1aa5ad04962cf1a72c570efc3f 100644 --- a/etc/vagrant/bootstrap.sh +++ b/etc/vagrant/bootstrap.sh @@ -74,12 +74,21 @@ NEO4J_SERVICE_NAME=neo4j-service NEO4J_SPATIAL_VERSION=0.12-neo4j-2.0.1 NEXUS_PATH=https://server.krismer.de/nexus/content/repositories/releases NEXUS_REPO=http://www.krismer.de/files/krismer.repo -OSM_BBOX_BZ="top=46.5200 left=11.3000 bottom=46.4500 right=11.3873" -OSM_BBOX_IBK="top=47.3592 left=11.3020 bottom=47.2108 right=11.4554" -OSM_FILE_AUSTRIA=austria-131201.osm.pbf -OSM_FILE_BZ=bozen-131201-filtered.osm -OSM_FILE_IBK=innsbruck-131201-filtered.osm -OSM_FILE_ITALY=italy-131201.osm.pbf +#OSM_BBOX_BZ="top=46.5200 left=11.3000 bottom=46.4500 right=11.3873" +#OSM_BBOX_IBK="top=47.3592 left=11.3020 bottom=47.2108 right=11.4554" +OSM_BBOX_BZ="${SHARED_CONF_DIR}/poly_bz.poly" +OSM_BBOX_IBK="${SHARED_CONF_DIR}/poly_ibk.poly" +OSM_BBOX_IT="${SHARED_CONF_DIR}/poly_it.poly" +OSM_BBOX_SF="${SHARED_CONF_DIR}/poly_sf.poly" +OSM_BBOX_ST="${SHARED_CONF_DIR}/poly_taa.poly" +OSM_FILE_AUSTRIA=europe/austria-140301.osm.pbf +OSM_FILE_ITALY=europe/italy-140301.osm.pbf +OSM_FILE_CALIFORNIA=north-america/us/california-140301.osm.pbf +OSM_FILE_BZ_FILTERED=bozen-140301-filtered.osm +OSM_FILE_IBK_FILTERED=innsbruck-140301-filtered.osm +OSM_FILE_IT_FILTERED=italy-140301-filtered.osm +OSM_FILE_SF_FILTERED=sanfrancisco-140301-filtered.osm +OSM_FILE_ST_FILTERED=southtyrol-140301-filtered.osm OSM_KEYS="aerialway,highway,public_transport,railway,route" OSM2PGROUTING_VERSION=v2.0.0 OSM2PGROUTING_MAPPING_CONF=$DEPLOY_DIR/osm2pgrouting/mapconfig.xml @@ -99,6 +108,9 @@ REPO_RPMFORGE_URL_32=http://pkgs.repoforge.org/rpmforge-release/rpmforge-release REPO_RPMFORGE_URL_64=http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm TABLE_PREFIX_BZ=bz_ TABLE_PREFIX_IBK=ibk_ +TABLE_PREFIX_IT=it_ +TABLE_PREFIX_SF=sf_ +TABLE_PREFIX_ST=st_ TEMPLATE_VERSION_PSIPROBE=2.3.3 TEMPLATE_FILE_CANIGET2=$NEXUS_PATH/de/krismer/CanIGet2/0.1/CanIGet2-0.1.war TEMPLATE_FILE_PSIPROBE=probe-$TEMPLATE_VERSION_PSIPROBE.zip @@ -182,7 +194,7 @@ fn_import_data() NAME=$1 OSM_FILE=$2 OSM_FILE_FILTERED=$3 - BBOX=$4 + BOUNDING=$4 SCHEDULE_FILE=$5 TABLE_PREFIX=$6 @@ -195,10 +207,15 @@ fn_import_data() if [ ! -f $DEPLOY_DIR/$OSM_FILE_FILTERED ]; then echo " - downloading OpenStreetMap file" - fn_download_newer $DOWNLOAD_DIR/$OSM_FILE http://download.geofabrik.de/europe/$OSM_FILE + OSM_FILENAME=$DOWNLOAD_DIR/${OSM_FILE##*/} + fn_download_newer $OSM_FILENAME http://download.geofabrik.de/$OSM_FILE echo " - filtering OpenStreetMap data" - $DEPLOY_DIR/osmosis/bin/osmosis --read-pbf file="$DOWNLOAD_DIR/$OSM_FILE" --bounding-box $BBOX --way-key keyList="$OSM_KEYS" --used-node --write-xml file="$DEPLOY_DIR/$OSM_FILE_FILTERED" >> initialize_osm_data.sh 2>&1 + if [[ "$BOUNDING" == *.poly ]]; then + $DEPLOY_DIR/osmosis/bin/osmosis --read-pbf file="$OSM_FILENAME" --bounding-polygon file="$BOUNDING" --way-key keyList="$OSM_KEYS" --used-node --write-xml file="$DEPLOY_DIR/$OSM_FILE_FILTERED" >> initialize_osm_data.sh 2>&1 + else + $DEPLOY_DIR/osmosis/bin/osmosis --read-pbf file="$OSM_FILENAME" --bounding-box $BOUNDING --way-key keyList="$OSM_KEYS" --used-node --write-xml file="$DEPLOY_DIR/$OSM_FILE_FILTERED" >> initialize_osm_data.sh 2>&1 + fi fi if $INSTALL_POSTGIS && $IMPORT_SCHEDULES; then @@ -462,7 +479,7 @@ fi if $INSTALL_PROJECT_PSIPROBE; then echo "Installing template project \"psi-probe\"" - fn_download_newer $DOWNLOAD_DIR/TEMPLATE_FILE_PSIPROBE https://psi-probe.googlecode.com/files/$TEMPLATE_FILE_PSIPROBE + fn_download_newer $DOWNLOAD_DIR/$TEMPLATE_FILE_PSIPROBE https://psi-probe.googlecode.com/files/$TEMPLATE_FILE_PSIPROBE unzip $DOWNLOAD_DIR/$TEMPLATE_FILE_PSIPROBE probe.war -d $TOMCAT_WEBAPP_DIR unzip -o -d $TOMCAT_WEBAPP_DIR/psiprobe $TOMCAT_WEBAPP_DIR/probe.war > install_psiprobe.log 2>&1 rm -f $TOMCAT_WEBAPP_DIR/probe.war >> install_psiprobe.log 2>&1 @@ -644,8 +661,11 @@ if $IMPORT_OSMDATA || $IMPORT_OSMDATA_CACHED; then echo " Importing data" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - fn_import_data "Bozen" "$OSM_FILE_ITALY" "$OSM_FILE_BZ" "$OSM_BBOX_BZ" "bz_export.sql.gz" $TABLE_PREFIX_BZ - fn_import_data "Innsbruck" "$OSM_FILE_AUSTRIA" "$OSM_FILE_IBK" "$OSM_BBOX_IBK" "" $TABLE_PREFIX_IBK + fn_import_data "Bolzen" "$OSM_FILE_ITALY" "$OSM_FILE_BZ_FILTERED" "$OSM_BBOX_BZ" "bz_export.sql.gz" $TABLE_PREFIX_BZ + fn_import_data "Italien" "$OSM_FILE_ITALY" "$OSM_FILE_IT_FILTERED" "$OSM_BBOX_IT" "it_export.sql.gz" $TABLE_PREFIX_IT + fn_import_data "SanFrancisco" "$OSM_FILE_CALIFORNIA" "$OSM_FILE_SF_FILTERED" "$OSM_BBOX_SF" "sf_export.sql.gz" $TABLE_PREFIX_SF +# fn_import_data "SuedTirol" "$OSM_FILE_ITALY" "$OSM_FILE_ST_FILTERED" "$OSM_BBOX_ST" "st_export.sql.gz" $TABLE_PREFIX_ST + fn_import_data "Innsbruck" "$OSM_FILE_AUSTRIA" "$OSM_FILE_IBK_FILTERED" "$OSM_BBOX_IBK" "" $TABLE_PREFIX_IBK if $INSTALL_GEOSERVER; then if $INSTALL_NEO4J_SPATIAL; then @@ -662,6 +682,9 @@ if $IMPORT_OSMDATA || $IMPORT_OSMDATA_CACHED; then sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_neo4j_ds.gs > setup_geoserver_neo4j.log 2>&1 sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_neo4j_ft_bz.gs >> setup_geoserver_neo4j.log 2>&1 sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_neo4j_ft_ibk.gs >> setup_geoserver_neo4j.log 2>&1 + sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_neo4j_ft_it.gs >> setup_geoserver_neo4j.log 2>&1 + sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_neo4j_ft_sf.gs >> setup_geoserver_neo4j.log 2>&1 +# sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_neo4j_ft_st.gs >> setup_geoserver_neo4j.log 2>&1 sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_neo4j_ft.gs >> setup_geoserver_neo4j.log 2>&1 fi if $INSTALL_POSTGIS; then @@ -673,6 +696,9 @@ if $IMPORT_OSMDATA || $IMPORT_OSMDATA_CACHED; then sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $WORKING_DIR/geoserver_setup_postgis_ds.gs > setup_geoserver_postgis.log 2>&1 sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_postgis_ft_bz.gs >> setup_geoserver_postgis.log 2>&1 sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_postgis_ft_ibk.gs >> setup_geoserver_postgis.log 2>&1 + sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_postgis_ft_it.gs >> setup_geoserver_postgis.log 2>&1 + sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_postgis_ft_sf.gs >> setup_geoserver_postgis.log 2>&1 +# sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_postgis_ft_st.gs >> setup_geoserver_postgis.log 2>&1 sh $DEPLOY_DIR/gs-shell/bin/gs-shell --cmdfile $SHARED_CONF_DIR/geoserver_setup_postgis_ft.gs >> setup_geoserver_postgis.log 2>&1 fi fi