[OSM-dev] Representing differences between sets of OSM data

Brett Henderson brett at bretth.com
Mon Aug 20 11:58:57 BST 2007


Great, that's good news.

Some pros and cons.

**** JOSM ****
Pros
Allows a single format that is also suitable for editors.
Avoids changes to JOSM.

Cons
File format is easily misinterpreted and not easily recognisable as a 
change file.
Doesn't include the previous value limiting some validation.
Requires optional attributes on elements.

**** Osmosis ****
Pros
Re-uses existing planet schema types.
Doesn't require optional attributes in xml files.
Each change is represented by single elements.

Cons
Doesn't include the previous value limiting some validation (Note that 
this validation can't be performed against a database anyway).

**** Planetdiff ****
Pros
Re-uses existing planet schema types.
Doesn't require optional attributes in xml files.
Allows the most validation to be performed when applying a change.

Cons
A modify is represented as two elements which must be tied together 
using the id.


What are the reasons for attempting to use a common format?  Might sound 
like a stoopid question but I'm curious what applications people have in 
mind at this point.  At this point I'm not convinced that JOSM changes 
should be represented in the same way as planetdiff/osmosis change sets 
but I'm still undecided on the best approach.

As a simple use case, how would each change for this node be 
represented?  I'm particularly interested to see how each format would 
represent the re-creates.
http://www.openstreetmap.org/api/0.4/node/2/history


Martijn van Oosterhout wrote:
> On 8/20/07, Brett Henderson <brett at bretth.com> wrote:
>   
>> Do you have a simple example of planetdiff data (ie. a small extract of
>> data)?
>>     
>
> I just looked at one of the files on planet.openstreetmap.org, for example:
> http://planet.openstreetmap.org/planet-070808-070815.diff.xml.bz2
>
>   
>>> I'll have to look a little more at the osmosis diffs. It would be good
>>> to converge on a common format.
>>>       
>
> The formats are already very very close. Below I've listed an example
> of the same change in all three formats. As you can see they are 99%
> identical. The only difficult part is that planetdiff has the old
> version, which neither of the other two formats have.
>
> For JOSM:
> <osm version="0.3" generator="JOSM">
>       <node id="12050350" timestamp="2007-01-02T00:00:00.0+11:00"
> lat="-33.9133118622908" lon="151.117335519304" action="modify">
>            <tag k="created_by" v="JOSM"/>
>        </node>
> </osm>
>
> For planetdiff:
> <planetdiff version="0.1" generator="planetdiff">
>    <delete>
>        <node id="12050350" timestamp="2007-01-02T00:00:00.0+11:00"
> lat="-33.9133118622908" lon="151.117335519304">
>            <tag k="created_by" v="JOSM"/>
>            <tag k="old" v="tag"/>
>        </node>
>    </delete>
>    <add>
>        <node id="12050350" timestamp="2007-01-02T12:00:00.0+11:00"
> lat="-33.9133118622908" lon="151.117335519304">
>            <tag k="created_by" v="JOSM"/>
>        </node>
>    </add>
> </planetdiff>
>
> And for osmChange:
> <osmChange version="0.3" generator="Osmosis">
>    <modify version="0.3" generator="Osmosis">
>        <node id="12050350" timestamp="2007-01-02T00:00:00.0+11:00"
> lat="-33.9133118622908" lon="151.117335519304">
>            <tag k="created_by" v="JOSM"/>
>        </node>
>    </modify>
> </osmChange>
>
> Have a nice day,
>   






More information about the dev mailing list