[OSM-dev] Fwd: Script to extract bbox from history planet

Peter Körner osm-lists at mazdermind.de
Tue May 3 11:48:04 BST 2011


Am 02.05.2011 17:38, schrieb Frederik Ramm:
> Hi,
>
> Martijn van Exel wrote:
>> Revisiting this old thread. I seem to remember this script was
>> superseded / made obsolete by something else, but can't find what /
>> where.
>
Hi

I just finished the first stage of my history splitter. It two splitting 
modes of which one is finished.

The "hard cut" mode features:
  - single pass
  - if an object is in the extract, all versions of it are there
  - keeps the "visible" attribute
  - ways are cropped at bbox boundaries
  - relations contain only members that exist in the file
  - ways and relations are reference-complete
  - needs only 170 MB RAM per BBOX

It's based on the osmium framework. Building it is a little complicated, 
as I have made changes to the osmium framework that are not yet merged 
into the main development line, but I'm in contact with jochen about this.

You need
  - the xml_tree branch of my osmium version:
    <https://github.com/MaZderMind/osmium/tree/xml_output>
      run: git clone git at github.com:MaZderMind/osmium.git
           git checkout xml_output

  - all prequisites mentioned in the readme file at
    <https://github.com/MaZderMind/osmium/tree/xml_output>

  - the splitter itsself
 
<https://github.com/MaZderMind/OpenStreetMap-History-API/tree/master/splitter>

and run it like that:
   bzcat path/to/full/history.osm.bz2 | ./splitter - example.config

this runs the above mentioned "hard cut" algorithm that changes ways and 
relations to be completely inside the box. You can read about the 
algorithm its features and disadvantages here: 
<https://github.com/MaZderMind/OpenStreetMap-History-API/blob/master/splitter/hardcut.hpp>

In the next step I'll implement the "soft cut" algorithm that keeps ways 
completed (you can read about it here: 
<https://github.com/MaZderMind/OpenStreetMap-History-API/blob/master/splitter/softcut.hpp>).

I'll try to provide several extracts in different sizes for the Hack 
Weekend in Essen.

Peter



More information about the dev mailing list