Global Positioning System Reference
In-Depth Information
Most of this information is irrelevant for map productions, and the node
element could be reduced to one line:
<node id=232389894 lat=49.0455424 lon=12.13113/>
This data reduction from 197 to 59 bytes 8 (30%) seems promising enough
to use it for data delivery to save a lot of disk space and processing time
for subsequent steps of the map compiler.
Program Design
Generally speaking, all processing steps of a map compiler are command
lines for the operating system. Therefore, many OS tools can be adapted
for different processes. A typical tool is the stream editor to perform text
manipulation on an input stream and write the output stream to a file.
While the stream editor is a rather generic tool, it can be helpful for a
map-compilation team to have a command line tool more sensitive to OSM
files.
For a deeper understanding of the parser for OSM files the reader
should open the file OSMparser.java and set the command line argu-
ments in the IDE. In this way, the parsing can be repeated multiple
times and stop points can be set in debug mode to analyze the tem-
porary data structure. For example, in Eclipse you would open
> set the Run Configurations > Arguments > Program arguments:
to enter the following example (in one line without breaks)
-rx"D:<yourpath> n products n GER n osm n gui n RGB-NW.osm"
-wx"D:<yourpath> n products n GER n osm n gui n RGB-NW.xWsHW.osm"
-xways"<tagk=.highway.*/>"
OSMparser.java
The OSMparser uses the idea of a streaming editor to read an OSM file
stream, parse, and modify elements, and write a modified OSM stream
back to the file system. The main processing steps are to
1. read every line of the OSM UTF8 input file;
2. identify one of the three OSM element types: <node|way|relation>
3. create a List<String>element for manipulation;
4. delete lines from each element matching a regular expression;
5. delete or filter elements identified by a regular expression;
6. write the modified elements to a specified output file.
8 Note that one integer and two double values require about 20 bytes in a database.
 
Search WWH ::




Custom Search