X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8c3a0efe8b75a06279998e66a932d8a56c483961..a96b6a1289e3a595b2d3753a1a038abc3f19721a:/utils/update_database.sh?ds=sidebyside diff --git a/utils/update_database.sh b/utils/update_database.sh index 75d0de5d..58f7690a 100644 --- a/utils/update_database.sh +++ b/utils/update_database.sh @@ -22,25 +22,14 @@ # REPLACE WITH LIST OF YOUR "COUNTRIES": # - - COUNTRIES="europe/monaco europe/andorra" -# SET TO YOUR NOMINATIM build FOLDER PATH: -# -NOMINATIMBUILD="/srv/nominatim/build" -UPDATEFILE="$NOMINATIMBUILD/utils/update.php" - -# SET TO YOUR update data FOLDER PATH: -# -UPDATEDIR="/srv/nominatim/update" - UPDATEBASEURL="https://download.geofabrik.de" UPDATECOUNTRYPOSTFIX="-updates" # If you do not use Photon, let Nominatim handle (re-)indexing: # -FOLLOWUP="$UPDATEFILE --index" +FOLLOWUP="nominatim index" # # If you use Photon, update Photon and let it handle the index # (Photon server must be running and must have been started with "-database", @@ -49,11 +38,10 @@ FOLLOWUP="$UPDATEFILE --index" #FOLLOWUP="curl http://localhost:2322/nominatim-update" # ****************************************************************************** - +UPDATEDIR="update" for COUNTRY in $COUNTRIES; do - echo "====================================================================" echo "$COUNTRY" echo "====================================================================" @@ -61,20 +49,16 @@ do FILE="$DIR/sequence.state" BASEURL="$UPDATEBASEURL/$COUNTRY$UPDATECOUNTRYPOSTFIX" FILENAME=${COUNTRY//[\/]/_} - - # mkdir -p ${DIR} - cd ${DIR} echo "Attempting to get changes" + rm -f ${DIR}/${FILENAME}.osc.gz pyosmium-get-changes -o ${DIR}/${FILENAME}.osc.gz -f ${FILE} --server $BASEURL -v echo "Attempting to import diffs" - ${NOMINATIMBUILD}/utils/update.php --import-diff ${DIR}/${FILENAME}.osc.gz - rm ${DIR}/${FILENAME}.osc.gz - + nominatim add-data --diff ${DIR}/${FILENAME}.osc.gz done echo "====================================================================" echo "Reindexing" ${FOLLOWUP} -echo "====================================================================" \ No newline at end of file +echo "===================================================================="