Convert OSM to CSV

Turn OSM files into CSV. A CSV with one row for each feature: its shape as WKT in a first column named WKT, then every attribute as a column.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop OSM files on the dialor turn it to pick what to do

Map features as rows in a table.Each feature becomes one CSV row, with its shape in the first column.

  1. What you get

    One CSV file with a row for each feature. The first column is named WKT and holds the shape as text. Every attribute follows as its own column.

    Coordinates are written as WGS 84 longitude and latitude. Common tags such as name, highway and building become columns. The other tags are kept together as JSON in other_tags.

  2. How shapes are mapped

    Tagged nodes become points. Ways become lines, or polygons when they are closed and tagged as areas. Route and multipolygon relations become multilines and multipolygons.

    A feature without a geometry keeps its row, with an empty WKT. If the data already has a column named WKT, it is renamed WKT_1. Lists and nested values become JSON text.

  3. What is left behind

    Untagged nodes are dropped. So are relations other than route and multipolygon relations, along with versions and authors.

    If the file has several layers, they are joined into one table. A layer column names where each feature came from.

OSM and CSV.What each format is.

The formats

From · OSM

OpenStreetMap Data

OpenStreetMap nodes, ways and relations with their tags, as .osm XML or the smaller .osm.pbf.

Extensions
.osm .osm.pbf
MIME type
application/vnd.openstreetmap.data+xml
Kind
Text and data
To · CSV

CSV

Rows of comma-separated values. The plainest way to move a table between programs.

Extensions
.csv
MIME type
text/csv
Kind
Text and data

In your code.The same OSM to CSV conversion through the API, for your app or your agent.

terminal
$ cv convert report.osm report.csv
$ cv convert report.osm report.csv

Questions.What people ask about OSM to CSV.

01OF 04

It is in the first column, named WKT, as a shape in text form. Features with no geometry have an empty WKT.

Common tags such as name, highway and building each get their own column. All other tags are kept as JSON in other_tags.

No. Versions and authors are dropped.

They are joined into one CSV. The layer column tells you which layer each feature came from.

More conversions.Other ways in and out of OSM and CSV.