X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8c3a0efe8b75a06279998e66a932d8a56c483961..3cc3e3b2e319c9db92da2efdefec2672780c5df9:/utils/import_multiple_regions.sh diff --git a/utils/import_multiple_regions.sh b/utils/import_multiple_regions.sh index 83323c2e..d15b2f55 100644 --- a/utils/import_multiple_regions.sh +++ b/utils/import_multiple_regions.sh @@ -8,8 +8,6 @@ # *) Set up sequence.state for updates -# *) Merge the pbf files into a single file. - # *) Setup nominatim db using 'setup.php --osm-file' # Hint: @@ -28,16 +26,6 @@ touch2() { mkdir -p "$(dirname "$1")" && touch "$1" ; } COUNTRIES="europe/monaco europe/andorra" -# SET TO YOUR NOMINATIM build FOLDER PATH: - -NOMINATIMBUILD="/srv/nominatim/build" -SETUPFILE="$NOMINATIMBUILD/utils/setup.php" -UPDATEFILE="$NOMINATIMBUILD/utils/update.php" - -# SET TO YOUR update FOLDER PATH: - -UPDATEDIR="/srv/nominatim/update" - # SET TO YOUR replication server URL: BASEURL="https://download.geofabrik.de" @@ -46,27 +34,24 @@ DOWNCOUNTRYPOSTFIX="-latest.osm.pbf" # End of configuration section # ****************************************************************************** -COMBINEFILES="osmium merge" +UPDATEDIR=update +IMPORT_CMD="nominatim import" mkdir -p ${UPDATEDIR} -cd ${UPDATEDIR} +pushd ${UPDATEDIR} rm -rf tmp mkdir -p tmp -cd tmp +popd for COUNTRY in $COUNTRIES; do - echo "====================================================================" echo "$COUNTRY" echo "====================================================================" DIR="$UPDATEDIR/$COUNTRY" - FILE="$DIR/configuration.txt" DOWNURL="$BASEURL/$COUNTRY$DOWNCOUNTRYPOSTFIX" IMPORTFILE=$COUNTRY$DOWNCOUNTRYPOSTFIX IMPORTFILEPATH=${UPDATEDIR}/tmp/${IMPORTFILE} - FILENAME=${COUNTRY//[\/]/_} - touch2 $IMPORTFILEPATH wget ${DOWNURL} -O $IMPORTFILEPATH @@ -74,18 +59,12 @@ do touch2 ${DIR}/sequence.state pyosmium-get-changes -O $IMPORTFILEPATH -f ${DIR}/sequence.state -v - COMBINEFILES="${COMBINEFILES} ${IMPORTFILEPATH}" + IMPORT_CMD="${IMPORT_CMD} --osm-file ${IMPORTFILEPATH}" echo $IMPORTFILE echo "====================================================================" done - -echo "${COMBINEFILES} -o combined.osm.pbf" -${COMBINEFILES} -o combined.osm.pbf - echo "====================================================================" echo "Setting up nominatim db" -${SETUPFILE} --osm-file ${UPDATEDIR}/tmp/combined.osm.pbf --all 2>&1 - -# ${UPDATEFILE} --import-file ${UPDATEDIR}/tmp/combined.osm.pbf 2>&1 -echo "====================================================================" \ No newline at end of file +${IMPORT_CMD} 2>&1 +echo "===================================================================="