[OSM-dev] Full history extracts

marqqs at gmx.eu marqqs at gmx.eu
Sat Dec 24 15:05:17 GMT 2011


Hi,

> Suppose I were to write a simple Perl script that streams the full
> history file (which is sorted by type then id then version), and wrap
> every "version 1" entry in <create>...</create> and every other entry
> in <modify>...</modify> unless it has visible=false in which case I'd
> choose <delete>...</delete>. 

if I got you right, you could use osmconvert to do the trick. Example:


Input file a.osh:
<osm version="0.6">
<node id="21" version="1" visible="false" lat="1" lon="1"/>
<node id="21" version="2" visible="false" lat="1" lon="1"/>
<node id="21" version="3" visible="true" lat="1" lon="1"/>
<node id="22" version="1" visible="true" lat="1" lon="1"/>
</osm>


Call:
./osmconvert a.osh -o=a.osc


Output file a.osc:
<?xml version='1.0' encoding='UTF-8'?>
<osmChange version="0.6" generator="osmconvert 0.5W">
<delete>
	<node id="21" version="1"/>
	<node id="21" version="2"/>
</delete>
<modify>
	<node id="21" lat="1." lon="1." version="3"/>
</modify>
<create>
	<node id="22" lat="1." lon="1." version="1"/>
</create>
</osmChange>


Regards
Markus

-------- Original-Nachricht --------
> Datum: Sat, 24 Dec 2011 10:19:27 +0100
> Von: Frederik Ramm <frederik at remote.org>
> An: dev at openstreetmap.org
> Betreff: Re: [OSM-dev] Full history extracts

> Hi,
> 
> On Sat, 24 Dec 2011 13:47:48 +1100
> Brett Henderson <brett at bretth.com> wrote:
> > Osmosis doesn't currently support the full history data format.  It
> > only supports the alternative osmChange format.
> 
> Suppose I were to write a simple Perl script that streams the full
> history file (which is sorted by type then id then version), and wrap
> every "version 1" entry in <create>...</create> and every other entry
> in <modify>...</modify> unless it has visible=false in which case I'd
> choose <delete>...</delete>. 
> 
> Do you think this would then work with Osmosis? 
> 
> Bye
> Frederik
> 
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev



More information about the dev mailing list