• No results found

The tool OSM2Shape was developed using a higher object-oriented programming language, not a scripting language. The platform chosen was Visual Studio 2008 provided by Microsoft, using VB.NET for programming. The chosen environment has the advantages of an easy design of a GUI, having access to all features of a modern programming language like complex data structure and support of XML, and having a good performance, which is needed, as the OSM file may contain a large amount of data

For writing the shape format, the Shapefile C Library from MapTools [6] with the .NET wrapper has been used. It creates and writes records into the shape format, which is based on the “simple features” vector data structure, standardized by the OGC. The standard defines how geographic information, such as points, lines or polygons, should be stored along with their spatial attributes in a normalized form. Used shape geometry types are points, polylines and polygons. Though the shape format is a sophisticated data structure, which is easy to update and does not need a lot of storage capacity, it does not include anything like a relationship between single elements. Therefore it cannot be solely used for OSM data; as it is XML compliant and uses a rich data typing system, allowing more complex and detailed constraints on the logical structure of an element. For holding the additional information, additional dbf-tables have to be created. [7]

To control the application, different configuration files have been defined. They are used to restrict the map features and tags to be converted, thus improving the run-time of the tool dramatically. The configuration files can be easily edited by the user.

For developing a desktop application that reads data from OSM files, few points have to be taken into consideration:

- A lot of data comes along with most of the points/ways/relations. However, there is no rule which information must be covered as attributes. It is up to the single mapper to decide which information to add in additional tags. So not to lose any information, it is necessary to collect first all information and select secondly those which are important to the user.

- Nodes are the only elements holding geometry information; hence, there is no node without spatial information. However, that is not the case with ways or relations. Therefore, a solution has to be found, to deal with missing geometry information in the later.

Veronica Wendlik, Dietrich Schröder

5 Case Study

Comparing achieved results of osm2Shape converter and osm2shp, it can be said that the recently developed application is able to extract more useable points. Fig 3 shows converted points over the study area Stuttgart - yellow points indicate that they are created using OSM2SHP; all other colors were chosen for the files created with the OSM2Shape converter.

Fig 3: Showing converted points out of a test region in Stuttgart - left using OSM Converter and Osm2Shp, right enlarging the marked area

The enlarged image in Fig 3 shows one of the problems occurring when using OSM2SHP – if a node is described by one or more tags (e.g. “created_by”), then the algorithm of OSM2SHP assumes that it is a point feature, though it might be just a vertex of a line.

Having a look at streets covering the same area, the results (Fig 6) appear to be much better for OSM2SHP. Due to that it can be said that OSM2SHP is of more use if the user is not interested in detailed information about the single streets, but just wants to have a look at the area. Same behavior can be observed for polygon elements (Fig 7), as certain map features, like waterways, may not be listed in the configuration file.

Fig 4: Converted line elements - left hand side using the developed converter, right hand side using OSM2SHP

Fig 5: Converted polygon elements - left hand side using the developed converter, right hand side using OSM2SHP

Converting relations still is a challenge that needs to be improved; there still are two main problems– first there can be relations inside relations, so the process of reading the data must be recursive. The second reason for having strange result like in Fig 8 is more a problem than a challenge: nodes, ways, or relations referenced by other elements might be missing – and due to that, those parts cannot be drawn.

Activating OpenStreetMap Data for GIS: Transforming OpenStreetMap XML Data to ESRI’s Shape Format

Internet-based Applications and Open Source Solutions

115 Fig 6: Converted relation using the developed converter - problems of missing data can be seen in the occurring

gaps in between lines

6

Discussion and Conclusion

Converting nodes and simple ways to shape format, using the tool developed, returns a much more satisfying result than transforming relations. However, it is a huge advantage that the elements are separated in different files giving much more flexibility to the user – by assigning other names or turning off feature classes in the GI- System.

Concerning ways, OSM2SHP converts more elements. However, this can be changed by simply adding additional map features to the configuration files. Converting relations is not possible with OSM2SHP and does still need some improvement in OSM2Shape.

References

1. OpenStreetMap. OSM Wiki. Sendai Earthquake and Tsunami. [Online] April 21, 2011. [Cited: May 30,

2011.] http://wiki.openstreetmap.org/wiki/2011_Sendai_earthquake_and_tsunami.

2. OpenStreetMap. OSM Wiki. Open Database License. [Online] December 19, 2010. [Cited: May 30, 2011.]

http://wiki.openstreetmap.org/wiki/Open_Database_License.

3. OpenStreetMap. OSM Wiki. Wir moechten die Lizenz aendern. [Online] [Cited: January 12, 2011.]

http://www.openstreetmap.de/lizenzaenderung.html.

4. Google Inc. Google Code. osm2shp. [Online] Google, 2011. [Cited: May 30, 2011.]

http://code.google.com/p/osm2shp/.

5. OpenStreetMap. OSM Wiki. OSMLib. [Online] December 5, 2010. [Cited: May 30, 2011.]

http://wiki.openstreetmap.org/wiki/OSMLib.

6. [Online] MapTools. [Cited: Juni 14, 2010.] http://shapelib.maptools.org/.

7. Zurich, ETH. Geodata Visualization and Interactive Training Environment. Vector Data Strucutres. [Online]

Institute of Cartography, September 1, 2010. [Cited: June 6, 2011.] http://geodata.ethz.ch/geovite/tutorials/L2GeodataStructuresAndDataModels/en/html/unit_u3Vector.html.

8. Wendlik, Veronica.Entwicklung eines Umsetzungstools fuer OpenStreetMap Daten. Stuttgart : s.n., 2011.

9. OpenStreetMap. OpenStreetMap Wiki. Map Making Overview. [Online] October 19, 2010. [Cited: June 26,

2011.] http://wiki.openstreetmap.org/wiki/Map_Making_Overview.

10. OpenStreetMap. OpenStreetMap Wiki. Legal FAQ. [Online] April 25, 2011. [Cited: June 26, 2011.]