From OpenStreetMap Wiki
(Redirected from Shapefile)
Jump to: navigation, search
Available languages — Shapefiles
· Afrikaans · Alemannisch · aragonés · asturianu · azərbaycanca · Bahasa Indonesia · Bahasa Melayu · Bân-lâm-gú · Basa Jawa · Basa Sunda · Baso Minangkabau · bosanski · brezhoneg · català · čeština · corsu · dansk · Deutsch · eesti · English · español · Esperanto · estremeñu · euskara · français · Frysk · Gaeilge · Gàidhlig · galego · Hausa · hrvatski · Igbo · interlingua · Interlingue · isiXhosa · isiZulu · íslenska · italiano · Kiswahili · Kreyòl ayisyen · kréyòl gwadloupéyen · Kurdî · latviešu · Lëtzebuergesch · lietuvių · magyar · Malagasy · Malti · Nederlands · Nedersaksies · norsk bokmål · norsk nynorsk · occitan · Oromoo · oʻzbekcha/ўзбекча · Plattdüütsch · polski · português · română · shqip · slovenčina · slovenščina · Soomaaliga · suomi · svenska · Tagalog · Tiếng Việt · Türkçe · Vahcuengh · vèneto · Wolof · Yorùbá · Zazaki · српски / srpski · беларуская · български · қазақша · македонски · монгол · русский · тоҷикӣ · українська · Ελληνικά · Հայերեն · ქართული · नेपाली · मराठी · हिन्दी · भोजपुरी · অসমীয়া · বাংলা · ਪੰਜਾਬੀ · ગુજરાતી · ଓଡ଼ିଆ · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം · සිංහල · བོད་ཡིག · ไทย · မြန်မာဘာသာ · ລາວ · ភាសាខ្មែរ · ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ‎ · አማርኛ · 한국어 · 日本語 · 中文(简体)‎ · 中文(繁體)‎ · 吴语 · 粵語 · ייִדיש · עברית · اردو · العربية · پښتو · سنڌي · فارسی · ދިވެހިބަސް

The shapefile is a common standard for representing geospatial vector data. There are several ways of working with Openstreetmap data and shapefiles.

About Shapefiles

Developed and regulated by Esri as a (mostly) open specification, the shapefile format spatially describes geometries as either 'points', 'polylines', or 'polygons'. In OpenStreetMap terms these can be considered as 'nodes', 'ways' and 'closed ways', respectively. Each geometry has a set of associated attributes. Broadly speaking these are a bit like OSM's tags.

The shapefile is in fact a grouping of several files formatted to represent different aspects of geodata:

  • .shp — shape format; the feature geometry itself.
  • .shx — shape index format; a positional index of the feature geometry to allow seeking forwards and backwards quickly.
  • .dbf — attribute format; columnar attributes for each shape, in dBase IV format.

There are also several optional files in the shapefile format. The most significant of these is the .prj file which describes the coordinate system and projection information used. Although not part of the Esri shapefile standard, the .lyr file is often included as it contains specifications of how to display the data (colour, labelling, etc) in ArcGIS software.

For more info see wikipedia

Obtaining shapefiles from OSM data

Download shapefiles

Pre-made shapefile downloads
  • download shapefiles created by Geofabrik, updated daily (usually) with a global extract and some countries. Shapefiles with the following are provided: buildings, landuse, natural, places, point, railways, roads and waterways.
  • download shapefiles from Coastline data only
  • Metro Extracts service by Mapzen offers shapefiles for major cities, updated weekly, with either every tag in one shapefile each for points, lines and polygons, or separate shapefiles for different tags
  • offers global and continental extracts. Shapefiles are generated for buildings, roads, landuse, places, POI, natural, hydrography and vegetation. Updated every two weeks.
  • here you can download openstreetmap data in shapefiles format. Data divided by regions: North and South America, Australia and Oceania, Africa, Europa and Asia.61 layers for download. Data filtered by "Map Features" conditions.
  • extract service offers shape files for more than 200 cities and regions worldwide, updated weekly. Separate shapefiles for points, places, waterways, roads, railways, landuse and buildings with relevant tags, then shapefiles with all points, lines and polygons together.
Services generating custom shapefile downloads
  • OSM2GIS - Simple tool developed by User:Arnaud974, one shapefile each with all tags for points, lines and polygons
  • Trimble Data Marketplace - Requires registration
  • HOT Exports service ( (code) - custom export based on tag files (or all tags) in certain developing world regions, with data about an hour old
  • Landcover Database Shapefile Download individual layers not only from OSM by a bounding box.
  • extract service offers shapefiles for an area of your choosing, updated weekly. Separate shapefiles for points, places, waterways, roads, railways, landuse and buildings with relevant tags, then shapefiles with all points, lines and polygons together.
  • Boundaries Map offers worldwide shapefiles of all administrative boundaries. Database will be updated at midnight, german time. Created by User:wambacher

Create your own shapefiles

  • QGIS ( - This desktop GIS software has a QGIS OSM Plugin allowing you to open OSM files and save them to shapefile
    note: OSM-Plugin only loads information from 8 keys and cuts values at 82 chars.
    Blog post on the steps to do it from JOSM
  • ArcGIS has a free editor toolbar as well, which creates geodatabases rather than shapefiles (an ArcGIS file format)
  • "Open Street Map layers importations applications" chapter in Orfeo Toolbox Cookbook, Orfeo Toolbox being available in QGIS through the Sextante plugin.
  • If you load OSM data into a PostGIS database using osm2pgsql, then you can use some PostGIS capable GIS software (e.g. those listed below) or run pgsql2shp (feature of PostGIS) to create a shapefile.
  • OSMLib - A ruby library which can convert to shapefile following a rules file.
  • osm2shp in OSM SVN (and a later version) - C++ script developed by User:Frederik Ramm used by Geofabrik for their shapefile downloads. Fast and scaleable, but maybe not so configurable
  • osm2shp in google code - C# conversion utility - Seems to be under development by User:Cipt2001
  • osm2shp on github - C++ conversion utility, can read complete planet.osm.gz and planet.osm.bz2 streams directly, support tag filtering, under development by User:minad
  • osm2shp Java - A very simple command line tool to convert OSM files to Shapefiles. Written in Java. No input from community on its project page.
  • Osmium can convert OSM data to shapefiles. The easiest way is using the included osmjs program which gives you a lot of flexibility in defining what OSM features should end up in what way in the shapefiles.
  • Converting OSM to GML - includes follow up information on going from GML to shapefile
  • LocalOsmToShp - To Translate local OpenStreetMap files to shapefiles. Browse C code, documents and examples in project files. Can translate points, ways and relations features, controlling the DBF file (columns and fields). By User:Jrtamayo
  • ogr2ogr - ogr2ogr/GDAL 1.10 or newer has support. Converts OSM data not only to shapefiles but to any vector format which has write support in GDAL/OGR - PostGIS, Oracle, MapInfo, GML, Spatialite etc.
  • Spatial Manager is a software suite for converting geospatial datasets. Includes its own OSM data provider.
  • OSM IQ

Obtaining OSM data from shapefiles

Whilst you may want to convert shapefiles into .osm format for some other reason (e.g. to work with OpenStreetMap related tools) such conversion is normally done as part of an import process. See Import/Shapefile for details.

Working with shapefiles

Using GIS

Main article: GIS software

There's lots of GIS software which works with shapefilese.

Other tools and tricks