x

osmconvert bugs (data loss during osmchange file processing)


  1. osmconvert bugs (data loss during osmchange file processing) · wlodek76 (Gast) · 16.10.2012 13:23 · [flux]

    Hello,

    Probably topic addressed to Marqqs who did this great application.
    There are some problems with osmchange file processing.

    #1 problem: <modify> after <delete> flag in osmchange file


    FILE: test.osm
    <?xml version='1.0' encoding='UTF-8'?>
    <osm version="0.6" generator="osmconvert 0.7C">
    <bounds minlat="48.98568" minlon="14.0998" maxlat="55.09949" maxlon="24.16522"/>
    <way id="112900205" version="9" timestamp="2012-09-06T07:21:08Z" changeset="13006214" uid="467703" user="Zbigniew_Czernik">
    <nd ref="1787597288"/>
    <nd ref="1787597289"/>
    <nd ref="1282156209"/>
    <nd ref="1282156239"/>
    <tag k="note" v="bing hires imagery"/>
    <tag k="render" v="yes"/>
    </way>
    </osm>


    FILE: test.osc
    <?xml version='1.0' encoding='UTF-8'?>
    <osmChange version="0.6" generator="Osmosis 0.41-7-g87182e9">
    <delete>
    <way id="112900205" version="10" timestamp="2012-09-13T21:38:08Z" uid="881947" user="Magolves-Sailing" changeset="13101471"/>
    </delete>
    <modify>
    <way id="112900205" version="11" timestamp="2012-09-13T23:41:12Z" uid="467703" user="Zbigniew_Czernik" changeset="13102209">
    <nd ref="1787597288"/>
    <nd ref="1787597289"/>
    <nd ref="1282156209"/>
    <nd ref="1282156239"/>
    <tag k="note" v="bing hires imagery"/>
    <tag k="render" v="yes"/>
    </way>
    </modify>
    </osmChange>


    COMANDLINE: osmconvert -v test.osm test.osc --out-osm -o=test_out.osm
    The way 112900205 in this example should be updated and added to the output file.

    #2 problem: <delete> after <create> flag in osmchange file


    FILE: test.osm
    <?xml version='1.0' encoding='UTF-8'?>
    <osm version="0.6" generator="osmconvert 0.7C">
    <bounds minlat="48.98568" minlon="14.0998" maxlat="55.09949" maxlon="24.16522"/>
    </osm>


    FILE: test.osc
    <?xml version='1.0' encoding='UTF-8'?>
    <osmChange version="0.6" generator="Osmosis 0.41-7-g87182e9">
    <create>
    <way id="112900205" version="1" timestamp="2012-09-13T23:41:12Z" uid="467703" user="Zbigniew_Czernik" changeset="13102209">
    <nd ref="1787597288"/>
    <nd ref="1787597289"/>
    <nd ref="1282156209"/>
    <nd ref="1282156239"/>
    <tag k="note" v="bing hires imagery"/>
    <tag k="render" v="yes"/>
    </way>
    </create>
    <delete>
    <way id="112900205" version="1" timestamp="2012-09-23T21:38:08Z" uid="881947" user="Magolves-Sailing" changeset="13101471"/>
    </delete>
    </osmChange>


    COMANDLINE: osmconvert -v test.osm test.osc --out-osm -o=test_out.osm
    The way 112900205 in this example should not be added to the output file.

    Attachement with documented bug here:
    http://www.wlodekk.w.interia.pl/osmconvert_bugs.zip

    Regards,
    Wlodzimierz


    • Re: osmconvert bugs (data loss during osmchange file processing) · quasilotte (Gast) · 16.10.2012 16:21 · [flux]

      The OSM objects in the change file must be unique. That means, there has to be only one occurrence of every node, way or relation. Minutely and hourly change files may contain more than one version of OSM objects, therefore you will get warning messages. You can combine all versions of each object if you specify the option --merge-versions. Then, only the newest version of each object will remain in the file.

      You have 2 self ID in Change (test.osc).

      You must running

      osmconvert -v test.osm test.osc --merge-versions --out-osm -o=test_out.osm


    • Re: osmconvert bugs (data loss during osmchange file processing) · wlodek76 (Gast) · 16.10.2012 19:16 · [flux]

      That's it.
      --merge-versions does this job.
      This is what I looked for.

      Thank you quasilotte and thanks to Markus for express explanation.

      Regards,
      Wlodzimierz