OSMLib

From OpenStreetMap Wiki
(Redirected from Osmlib)
Jump to: navigation, search

OSMLib (osmlib.rubyforge.org) is a Ruby library for reading, exporting and generally handling OSM data. It is a set of ruby modules and classes developed by Jochen Topf and released to the public domain.

OSMLib allows us to export OSM-data to most common GIS-Formats like Shapefiles (shp), Google Earth (kml), comma separated values (csv) and preliminary gpx (GPS-Exchange Format).

See https://github.com/emacsen/osmlib-base for an updated version.

Installation

Requires ruby1.8-dev

osm to shapefile conversion

Firstly it should be noted that OSMLib's shapefile conversion is rather inefficient, and this is not the conversion utility used by Geofabrik to create their shapefile downloads. See Shapefile page for a list of alternative approaches.

If you want to try using OSMLib, you have to specify which kind of information you're interested in. This is done by a Rulefile in Ruby Syntax. Please make yourself familiar with the OSM Library Documentation for further details. There's also a setup section for export notes into Shapefile.