3

I have an osm file. I am trying to convert it to geojson with ogr2ogr. I get an error that ogr2ogr can't handle multiple layers. How can I tell what layers are in the file and remove them? I see from How to remove layers of detail from an osm file? that OSM files might not even have layers. So what is the meaning of this error message?

3

The OGR OSM driver categorize features into 5 layers:

  • points : "node" features that have significant tags attached.
  • lines : "way" features that are recognized as non-area.
  • multilinestrings : "relation" features that form a multilinestring(type = 'multilinestring' or type = 'route').
  • multipolygons : "relation" features that form a multipolygon (type = 'multipolygon' or type ='boundary'), and "way" features that are recognized as area.
  • other_relations : "relation" features that do not belong to the above 2 layers.


You have to specify the layer that you are interested in. For instance if your are interested in points you would use the following command:

ogr2ogr your-new-file your-osm-file.osm points


For more information have a look at the OGR OSM drive specifications.

  • 2
    Just to avoid any misunderstandings: Currently the OSM data schema itself doesn't know a layer concept. – Mapper Mar 12 '14 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.