Re: [OSM-dev] Difference between osm and osmChange formats

2011-06-02 Thread Peter Körmer

Am 01.06.2011 19:29, schrieb Sergey Galuzo:

As far as special format for diffs... Why do we have it as opposed just to 
using full history format for diffs? Same data...


Do-o-crathy. Some one wrote a full-history dumper and now we have the 
full-history format. Someone else wrote the minutely-diff-thing and now 
we have a diff-file-format.


Peter

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difference between osm and osmChange formats

2011-06-01 Thread Peter Körner

Am 31.05.2011 23:43, schrieb Sergey Galuzo:


varchangeTag = !Visible ? delete : Version == 1 ? create : modify;


This may be true when you look at an object's complete history.

But don't let you confuse from the similar syntax of .osm and .osc files 
-- they represent very different things.


It's like comparing a .cpp-file with a .patch-file -- you can produce 
one out of the other but despite that they have not many things common.


Peter

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difference between osm and osmChange formats

2011-06-01 Thread John Smith
On 1 June 2011 17:51, Peter Körner osm-li...@mazdermind.de wrote:
 Am 31.05.2011 23:43, schrieb Sergey Galuzo:

 varchangeTag = !Visible ? delete : Version == 1 ? create : modify;

 This may be true when you look at an object's complete history.

 But don't let you confuse from the similar syntax of .osm and .osc files --
 they represent very different things.

The original poster had it mostly correct, they are almost identical
expect for the create/modify/delete tags and the osc file uses
osmChange instead of osm

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difference between osm and osmChange formats

2011-06-01 Thread Frederik Ramm

Hi,

On 05/31/11 23:43, Sergey Galuzo wrote:

Obvious differences between full and change are explicit
create/modify/delete tags.


We have full history OSM files and normal OSM files (both use .osm 
extension and osm.../osm), and we have simple diffs and replication 
diffs (both use .osc and osmChange.../osmChange).


Normal OSM files never have a visible attribute, and they contain at 
most one version of every object.


Objects in full history OSM files contain a visible attribute, and 
these files may contain different versions of the same object, with at 
most one having visible=true. If there is a version with visible=true, 
it will be the highest numbered version of that object. They do not 
necessarily contain a full sequence of versions, i.e. you could have a 
full history file that only has versions 2 and 5 of something.


(There are also .osm files as written by the JOSM editor; these do not 
have a visible attribute but may have an action attribute which, if 
set to delete, has a similar effect. This is a niche case.)


The diffs contain delete, modify, and create blocks. A version in 
create is usually 1. (Current implementation means it is *always* 1 
but this could be changed; it is not specified in the API that the first 
version of something must always be 1.) A version in create or 
modify can never have visible=false.


If you have full replication diffs then one diff can contain the same 
object multiple times, with different version numbers. It is possible 
for the same object to appear in the create, modify, and delete 
section of the same replication diff. Versions are not guaranteed to be 
sorted, i.e. you could first encounter version 6 in a delete block and 
later encounter version 5 in a modify.


Since multiple edits are conflated in a simple diff, it is possible that 
a simple diff contains an object as version 2 in a modify block but 
the consumer has never before seen that object (because the version 1 
that would have been in a create has happened in the same diff 
interval as the modification to version 2).


In short, your assumption

var changeTag = !Visible ? delete : Version == 1 ? create : modify;

is mostly true but it depends very much on the context in which you want 
to use it; there's a lot of things to trip you over.


Bye
Frederik

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difference between osm and osmChange formats

2011-06-01 Thread Andy Allan
On Wed, Jun 1, 2011 at 2:34 PM, Frederik Ramm frede...@remote.org wrote:

 We have full history OSM files and normal OSM files (both use .osm extension
 and osm.../osm), and we have simple diffs and replication diffs (both
 use .osc and osmChange.../osmChange).

 Normal OSM files never have a visible attribute, and they contain at most
 one version of every object.

Not quite true - API map calls return normal OSM files with the
visible attribute set.

 Objects in full history OSM files contain a visible attribute, and these
 files may contain different versions of the same object, with at most one
 having visible=true.

Again, not quite true - full history files returned by the api history
calls contain different versions of the same object, where many
versions can be shown with the visible=true attribute.

Perhaps it could be summarised as There are many different pieces of
software generating both normal and full-history OSM files, and simple
and replication diffs, and the visible attribute may or may not appear
in any of them. :-)

Cheers,
Andy

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difference between osm and osmChange formats

2011-06-01 Thread Sergey Galuzo
Thanks for excellent info.

As far as special format for diffs... Why do we have it as opposed just to 
using full history format for diffs? Same data...

Thanks,
Sergey.

-Original Message-
From: Frederik Ramm [mailto:frede...@remote.org] 
Sent: Wednesday, June 01, 2011 6:34 AM
To: dev@openstreetmap.org
Subject: Re: [OSM-dev] Difference between osm and osmChange formats

Hi,

On 05/31/11 23:43, Sergey Galuzo wrote:
 Obvious differences between full and change are explicit 
 create/modify/delete tags.

We have full history OSM files and normal OSM files (both use .osm extension 
and osm.../osm), and we have simple diffs and replication diffs (both use 
.osc and osmChange.../osmChange).

Normal OSM files never have a visible attribute, and they contain at most one 
version of every object.

Objects in full history OSM files contain a visible attribute, and these 
files may contain different versions of the same object, with at most one 
having visible=true. If there is a version with visible=true, it will be the 
highest numbered version of that object. They do not necessarily contain a full 
sequence of versions, i.e. you could have a full history file that only has 
versions 2 and 5 of something.

(There are also .osm files as written by the JOSM editor; these do not have a 
visible attribute but may have an action attribute which, if set to 
delete, has a similar effect. This is a niche case.)

The diffs contain delete, modify, and create blocks. A version in 
create is usually 1. (Current implementation means it is *always* 1 but this 
could be changed; it is not specified in the API that the first version of 
something must always be 1.) A version in create or modify can never have 
visible=false.

If you have full replication diffs then one diff can contain the same object 
multiple times, with different version numbers. It is possible for the same 
object to appear in the create, modify, and delete section of the same 
replication diff. Versions are not guaranteed to be sorted, i.e. you could 
first encounter version 6 in a delete block and later encounter version 5 in 
a modify.

Since multiple edits are conflated in a simple diff, it is possible that a 
simple diff contains an object as version 2 in a modify block but the 
consumer has never before seen that object (because the version 1 that would 
have been in a create has happened in the same diff interval as the 
modification to version 2).

In short, your assumption

var changeTag = !Visible ? delete : Version == 1 ? create : modify;

is mostly true but it depends very much on the context in which you want to use 
it; there's a lot of things to trip you over.

Bye
Frederik

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difference between osm and osmChange formats

2011-05-31 Thread Matthias Meisser

hi there Sergey,
well yes OSM has different XML 'flavours' but AFAIK osmChange doesnt 
contain the Visible attribute. This is used by editors as JOSM as a flag 
for removed objects.

A good comparision is this page: http://wiki.openstreetmap.org/wiki/XML

bye
Matthias

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev