Import/Shapefile

From OpenStreetMap Wiki
Jump to: navigation, search


This article is about importing ESRI Shapefiles into OSM. A shapefile is a popular geospatial vector data format for geographic information systems software. Shapefiles spatially describe geometries: points, polylines, and polygons.

Depending on the origin of the shape file, it may be necessary to not only convert but also simplify the shapes from the shapefile (a.k.a. "generalization") because it has many more nodes than we can actually use. Also shapefile data should not be uploaded to OSM until consideration has been given to making the data topologically correct. If data is uploaded without reviewing for compatibility it may need to be removed to avoid other contributors having to spend many hours making it topologically correct. Duplicate node issues are a significant concern in this respect.

Other shapefiles, e.g. those describing the PGS coastline, lack the fine resolution which we'd like them to have. The mere fact that data is in shapefile format does not mean that it contains high-quality data. Some contain data which was traced from small-scale paper maps.

Conversion to osm format

There are multiple tools for converting shapefiles into .osm format suitable for importing. These include:

1) If a shapefile is a polygon it may be better to convert it into a net of lines to import lines between net nodes instead of polygons with overlapping boundaries. In QGIS: ,,Menu Plugins/GRASS/New mapset". Then ,,Menu Plugins/GRASS/Open GRASS Tools". In a tab ,,Modules Tree/File management/Import vector into GRASS/" by v.in.ogr.qgis for example. In a module tab click ,,Show advanced options" and tick ,,Import area boundaries as lines".
2) In a tab ,,Modules Tree/Vector/Toolset for cleaning topology of vector map/v.clean.bpol"
3) Menu ,,Plugins/ Manage Plugins..." enable ,,GPS Tools".
4) Menu ,,Plugins/GPS Tools/Create new GPS layer"
5) Select feature(s) in the cleaned layer. Copy, paste into a GPS tracks layer, save the changed layer.
6) In GPX Editor open the gpx file. Menu ,,Edit/ OpenStreetMap Tools/ Anonymize time".
7) In JOSM install JOSM/Plugins/Reverter just in case. Open the gpx file.

See also

Personal tools
Namespaces
Variants
Actions
site
Toolbox