Download Latest Version osmtoolz_0_3_1.tar.gz (35.5 kB)
Email in envelope

Get an email when there's a new version of trafalgar.map

Home / osmtoolz
Name Modified Size InfoDownloads / Week
Parent folder
osmtoolz_0_3_1.tar.gz 2014-09-29 35.5 kB
README 2014-09-29 4.2 kB
osmtoolz_0_3_0.tar.gz 2013-12-29 27.8 kB
osmtoolz_0_2_1.tar.gz 2013-11-09 21.2 kB
osmtoolz_0_2_0.tar.gz 2013-08-22 13.2 kB
osmtoolz_0_1_1.tar.gz 2013-04-22 8.5 kB
osmtoolz_0_1_0.tar.gz 2013-04-06 8.9 kB
Totals: 7 Items   119.3 kB 0
This is a package which provides a XML parser for OpenStreetMap (OSM)
files which is able to read from compressed files.

Prerequisites:

- gcc/g++/make 
- zlib

Installation:

Copy the package to the work directory and extract it:

gunzip osmtoolz_0_3.1.tar.gz
tar -xvf osmtoolz_0_3.1.tar

Build the tag list application:

cd osm_tags
make

The one and only input parameter is an OSM XML file which is
compressed with gzip. It will not work with uncompressed
files or files which are compressed with bzip2 as they can be
found on the download servers.

There is a small script which does the transcoding from bzip2
to gzip without extracting it fully to disk:

The script expects a bzip2 compressed file without the
bz2 extension as the parameter. If your compressed file is
'planet-080430.osm.bz2', just type

../bz2_to_gz.sh [path_to/]planet-080430.osm

The script will keep the bzip2 zipped file and add another
one with .gz extension. 

Now the tag list extractor can be started as follows:

[path_to/]osm_tags [path_to]<osmfile.gz>

The tool will create two result files:

tags_test1.txt
The full list of tags, each of it with the list of arguments
(may be a huge file)

tags_test2.txt
Only the tags used in the OSM file.

Disk size considerations:

The gziped file is about 10% to 20% bigger than the bzip2 compressed
file while the uncompressed osm file is about 10 times larger than
the the compressed one. 

Calculation example:

If the downloaded osm file (.bz2) has a size of 10 GB you will need
about 12 GB additional free space for the transcoding to gzip format
but you would need 100 GB if you want it fully extracted.

-----------------------------------------------------------------

The split application creates seperated files for nodes, ways and
relations and a control file with additional information. 
The control file is used to store ID information of the OSM
subsection: number of elements and min/max value of the ID namespace.

This information may be useful for other applications to detect
the best way to store index information.

Build the split application:

cd osm_split
make

The one and only input parameter is an OSM XML file which has 
to be compressed with gzip. It will not work with uncompressed
files or files which are compressed with bzip2 as they can be
found on the download servers.

Please see the section above about the transcoding from
'*.bz2' to '*.gz' for more information

Now the split tool can be started as follows:

[path_to/]osm_split [path_to]<osmfile.gz>

The tool will create following files in the result folder:

info_20.osm.gz  -> id information
node_20.osm.gz  -> node section of file
way_20.osm.gz   -> way section of file
rel_20.osm.gz   -> relation section of file

Disk size considerations:

As the application reads from compressed files (*.gz) and writes
directly to compressed files, the space needed is twice the space
of the source osm file. 

-----------------------------------------------------------------

The cut application creates a rectangular sub-area of the given OSM
map. 

Build the cut application:

cd osm_cut
make

Parameter:
-f: input file (info file inside the folder with splitted files)
-r: rectangle definition, west to east, south to north.

Example (GB):
./osm_cut -f [path_to]/info_20.osm.gz -r -11.0,4.0,50.0,60.0

Known limitations:

* relation file is not splitted and copied 'as is'
* selections only possible from -180° to +180° possible
* only rectangular selections possible

-----------------------------------------------------------------

The cut application creates a rectangular sub-area of the given OSM
node file. The node pre-selection is helpful if osm_cut fails 
because of missing memory. The preselected rectangle should be
much more bigger than the rectangle for the final selection.

Build the cut application:

cd osm_nodes
make

Parameter:
-f: input file (info file inside the folder with splitted files)
-r: rectangle definition, west to east, south to north.

Example (GB):
./osm_cut_nodes -f [path_to]/info_20.osm.gz -r -11.0,4.0,50.0,60.0

Known limitations:

* relation file is not splitted and copied 'as is'
* selections only possible from -180° to +180° possible
* only rectangular selections possible

Source: README, updated 2014-09-29