[OSM-talk] resolved: using osmosis to make a change file and changed lat & long precision between source files
D Tucny
d at tucny.com
Mon Sep 24 05:01:36 BST 2007
Hi Folks,
First of all, the problem I'm trying to resolve is this... I generated an
area of coastline data with coast-josm.pl, I fixed up the data extensively
in josm, I downloaded adjoining data and merged it all together and tidied
up some nearby features, then went to upload... after a number of days of
rehitting upload to continue from timeouts a power failure hit... I have a
saved osm file from just before I started uploading, one from part way
through, and I've just downloaded the overall area through the API using the
original bounding boxes...
End result is that the database now has, probably mostly nodes, up to the
point the upload reached before the power failure and if I try uploading
again from either of my saved files, there will be duplicate data in the
database...
So, my I came up with the plan of using osmosis' change file feature...
basically, make a change set from current data to previous data inc
additions and changes... I've already checked there have been no other edits
in the area between, so, should all be OK, then I could use the bulk_upload
tool which I believe copes better with connection timeouts than josm...
The problem I'm having is this... I've created the change file OK... but,
it's bigger than the other files, which I thought was a bit strange... then
I noticed this...
change file has this
<modify version=" 0.4" generator="Osmosis">
<node id="35834222" lat="30.2643337" lon="120.1297524"
timestamp="2007-08-24T02:16:48.000Z" user="dkt">
<tag k="created_by" v="JOSM"/>
</node>
current response from the API gives this (the source for the change file)
<node id='35834222' timestamp='2007-08-24 10:16:48' user='dkt'
visible='true' lat=' 30.2643337' lon='120.1297524'>
<tag k='created_by' v='JOSM' />
</node>
the data as it stood when I started this was this (the dest for the change
file)
<node id='35834222' timestamp='2007-08-24 10:16:48' user='dkt'
visible='true' lat=' 30.2643336669513' lon='120.129752427981'>
<tag k='created_by' v='JOSM' />
</node>
eek... I'm thinking that osmosis can see the difference between the
precision of the coords in the two files, so, writes it up as a
modification, but, then writes the new coords to the same reduced
precision...
So... I was writing here because I couldn't think of a solution... but...
low and behold... I had an idea while I was writing...
Solution... pipe the (original/dest) file (with the old, more precise
lat/long) through osmosis...
Further sorting both input files with
--sort type="TypeThenId"
solved the last of the problems and made a much smaller change file...
So, now that osmosis seems to have solved all my problems, I'd first like to
thank Brett for writing it! but in case anyone else finds themselves trying
to do something similar, potentially with a planet file even, this mail
might help...
Now on to checking out bulk_upload...
Thanks!
d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20070924/461a1557/attachment.html>
More information about the talk
mailing list