The Trafalgar OSM file format is an archive with the sections of the standard OSM XML file format, each in it's own file. Some additional information is extracted and stored in the info file. Here is the content of an Trafalgar OSM XML set:
File | Description |
---|---|
info_20.osm.gz | Basic description file |
node_20.osm.gz | node section |
way_20.osm.gz | way section |
rel_20.osm.gz | relation section |
The info file contains information about the origin of the file and information which is useful to find the best way to store the data in memory for fast access
Example:
<?xml version='1.0' encoding='UTF-8'?>
<osm version="2.0" generator="osmtoolz">
<origin file="planet-071010.osm.gz" version="0.5" generator="OpenStreetMap planet.c" />
<sections n="4" >
<nodes n="41758170" min="2" max="62169198" member="0"/>
<ways n="4549905" min="35" max="8698245" member="5162"/>
<relations n="2245" min="1" max="2291" member="0"/>
<segments n="0" min="0" max="0" member="0"/>
</sections>
</osm>
While 'n' is the absolute number of elements, 'min' and 'max' refer to the ID range of the data set. With this information it is possible to calculate the memory which would be needed to store the information in various ways before starting to read.
The 'member' parameter is optional and currently used only within the 'way' data set. It stands for the largest number of nodes of a single way. The 'segments' data set is reserved for old data (before 10.10.2007) which is stored in the 0.3 API format (http://wiki.openstreetmap.org/wiki/API_v0.3).
The tag (osm_tags) info tool demonstrates how to use the XML parser. It just extracts and counts the 'k' and 'v' tags of a normal OSM file. The input is a standard OSM file which contains all sections in one file.
The split tool (osm_split) is needed to transform the standard OSM file format to the Trafalgar OSM file format. Upcoming tools will depend on the Trafalgar format because they will need the additional information which is stored in the info file.
Calling conventions:
osm_split [path_to/OSM file]
The split tool (osm_split) is used to extract a rectangular subset of the given file and writes it to another Trafalgar OSM file.
Calling conventions:
-f [source]
The source file is the 'info_20.osm.gz' file inside a Trafalgar OSM data set.
-r [west,east,south,north]
Selected rectangle in comma separated coordinates, for example '-11.0,4.0,50.0,60.0' for Great Britain.
This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
The wiki uses Markdown syntax.