osmcode / pyosmium

Python bindings for libosmium
https://osmcode.org/pyosmium
BSD 2-Clause "Simplified" License
318 stars 65 forks source link

pyosmium-get-changes returns with error, if start ID is up to date #232

Closed RhinoDevel closed 1 year ago

RhinoDevel commented 1 year ago

When executing pyosmium-get-changes with a start ID that equals the sequence nr. that is currently in the state.txt file on the server, there are just no updates available (no problem). But pyosmium-get-changes returns with error in that case. This seems to be more or less cosmetic (at least for Nominatim DB updates), because an empty output file is still generated and nominatim add-data seems to have no problem with that.

Example BASH script to trigger the error message (make sure that CUR_ID really matches the server's state.txt's content):

#!/bin/sh -u

CUR_ID="3791" # Make sure that this really matches the server's state.txt's content.
OUT_FILE="test_diff_output_file.osc.gz"

rm -f $OUT_FILE # (just to avoid "file exists" error when repeating the test)

pyosmium-get-changes \
 -vv \
 --outfile $OUT_FILE \
 --server https://download.geofabrik.de/europe/germany/niedersachsen-updates \
 --start-id $CUR_ID
lonvia commented 1 year ago

This is intentional behaviour, so you can implement a logic that only calls software to process the changefile, when it is valid and contains actual data.