Closed gregtzar closed 6 years ago
Thanks for all you work, but there is already a pull request (#158) that addresses all(?) your changes. :-(
It is still titled WIP, but I it only waits for a final review and merge by me. It would help me if you could review and test this pull request and give it a +1 if everything looks good.
I have created a pull request which adds several features and fixes a few bugs:
replicationUrl
parameter written intolast.state.txt
during import was hard coded ashttps://planet.openstreetmap.org/replication/minute/
regardless of the data source. I have made it dynamic, based on thereplication_url
specified in theconfig.json
. This allows region specific imports from a data source likegeofabrik.de
to output validlast.state.txt
parameter values that can now be leveraged by a tool likeosmosis
to generate region specific changes lists.replication_interval
parameter value in theconfig.json
is now taken into account when generating the sequence number which is output into thelast.state.txt
file. Before this fix the sequence number was hard coded to be based on a single minute so when performing thediff
command on an hourly or daily changes list the sequence number would be wrong (usually negative).replication_interval
parameter inconfig.json
got overwritten by the default flag when no flag is specified (should flags or config.json take priority when both are set?).Additionally, before the pull request is accepted the following two points should be discussed:
BaseOptions.DiffStateBefore
parameter inupdate:state:state.go:FromPbf()
function won't break anything since I am now calculating it based on the replication interval. It is not clear to me what the purpose of theBaseOptions.DiffStateBefore
parameter is.BaseOptions.DiffStateBefore
? In the case of a 24H changes list it is causing the sequence to be off by an entire day. Not a problem I suppose but it just feels sloppy. What problem is having this default value trying to solve?