[OSM-dev] Representing differences between sets of OSM data
Brett Henderson
brett at bretth.com
Sun Aug 19 23:46:46 BST 2007
The osmosis file format is very much undocumented :-) I'd like to work
with Jon at some point to see if planetdiff and osmosis can align more
closely but I've been putting it off until I finish the rest of the
code. The storage format is not terribly difficult to change if the
data remains similar. At some point I'd like to use proper schemas for
the planet and osmChange formats, but I'm not there yet.
Similar to Jon, I intentionally avoided using the JOSM approach. One
reason is that JOSM is capable of producing new data, osmosis (and
planetdiff) simple transmit information about entities that already
exist in one place but not another.
As an FYI, Osmosis does the following.
The overall xml document tag is called osmChange and looks like:
<osmChange version="0.3" generator="Osmosis">
Within that tag exist "create", "modify" and "delete" tags. These tags
and their children are identical to the structure within a planet file.
In other words, each "create" tag is in effect a mini planet file, I
actually use the same code to generate these tags as complete planet files.
Example. This modifies existing node 12050350. There's a bit of
redundancy with the version and generator elements at the "modify"
level, I probably should remove these.
<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>
If represented as schema files, the "create", "modify" and "delete"
elements in the osmChange schema would share the same complex type as
the "osm" element in a planet file.
From memory, one area that planetdiff is different is that it includes
the old and new versions of a modified entity. Osmosis only includes
the new version. Osmosis could include the old version but it adds
considerable complexity to database queries and is likely to adversely
affect performance. I have no plans to do this unless there's a strong
requirement for it.
Jon Burgess wrote:
> On Sun, 2007-08-19 at 19:10 +0200, Martijn van Oosterhout wrote:
>
>> Hi,
>>
>> >From the looks of it there are at least three ways of representing
>> changes to OSM data:
>>
>> 1. The format used by JOSM (adds action=(modify|delete)) to entities
>> 2. The format used by the planetdiff (used add/delete entities)
>> 3. The osmChange format used by osmosis (can't find docs on this)
>>
>> Now, I don't really want to have to support all of these at once, so
>> does anyone have any recommendations about which one is the best to
>> use, and if there are any conversion programs that can convert between
>> them.
>>
>
> I think the different file formats reflect the different aims of the
> applications. In addition to the obvious format differences between JOSM
> and planetdiff, the applications store different data in the files.
>
> In JOSM you get data which is unmodified too. Also the data in JOSM is
> complete, i.e. if there is a way, then you also have the relevant
> segments and nodes which it references. In the planetdiff this is not
> the case. The planetdiff may have information saying a <seg> was added
> to a way but may not include any other information about the underlying
> <segment>.
>
> In theory I could probably adapt the planetdiff format to be closer to
> that used by JOSM but I'd need to be convinced it was really worth the
> effort. I'd be against adding information about the unmodified nodes and
> segments to the diff since this would increase the file size and also
> break the streaming algorithm which the diff tool currently uses.
>
> Jon
>
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
>
More information about the dev
mailing list