[OSM-dev] Adding osmosis_replication_* fields to a pbf file

marqqs at gmx.eu marqqs at gmx.eu
Fri Nov 22 12:38:07 UTC 2013


Hi Jocelyn,

in PBF files there is only one kind of file timestamp: 
"osmosis_replication_timestamp". It has been defined here:
 
https://wiki.openstreetmap.org/wiki/.pbf#Definition_of_the_OSMHeader_fileblock

The timestamp field osmconvert retrieves from a pbf file is indeed this 
"osmosis_replication_timestamp".

osmconvert does not care about the remaining two osmosis-related .pbf 
file parameters:
osmosis_replication_sequence_number and osmosis_replication_base_url

To read these parameters you could add some debug output to the code 
(see lines marked with arrows):

           case 0x80:  // 0x02 V 32, osmosis_replication_timestamp ,,,
             if(bp[1]!=0x02) goto h_unknown;
             bp+= 2;
             pb_filetimestamp= pbf_uint64(&bp);
             break;
           case 0x88:  // 0x02 V 33, osmosis_replication_sequence_number
             if(bp[1]!=0x02) goto h_unknown;
             bp+= 2;
             pbf_uint64(&bp);  // (ignore this element)   <-----------
             break;
           case 0x92:  // 0x02 S 34, osmosis_replication_base_url
             if(bp[1]!=0x02) goto h_unknown;
             bp+= 2;
             l= pbf_uint32(&bp);
             bp+= l;  // (ignore this element)   <-----------
             break;

If you need these data fields on a regular basis, I would like to 
suggest that I added some coding to the osmconvert master source. Please 
let me know.

Bye
Markus

Am 18.11.2013 21:30, schrieb Jocelyn Jaubert:
> Hi,
>
> According to the following webpage, it is possible to add optional
> informations to the pbf file about replication configuration.
>
> http://wiki.openstreetmap.org/wiki/Pbf#Encoding_OSM_entities_into_fileblocks
>
> I'm using osmosis to generate my PBF files with replication, and I expect
> osmosis to write these fields. Is it correct ?
>
>
> Is there an existing tool to read or write these fields ?
>
>
> I've tried "osmconvert --out-statistics", which shows a timestamp field, but
> no osmosis_replication_* fields.
>
>
> Thanks,
> Jocelyn
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev
>



More information about the dev mailing list