Export

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages
Deutsch English español français italiano 日本語 русский

'Export' and 'sharing' side bars

Export and sharing sidebars, both showing at once on OpenStreetMap.org

You can use sidebars on the OpenStreetMap.org front page to carry out basic exports of map images or raw data of a particular area.

These interface elements were recently re-arranged, and may be subject to further changes

OpenStreetMap XML Data

Use the 'export data' link on the left to open the export sidebar, to get OpenStreetMap XML data for an area.

All the current raw OpenStreetMap data (Nodes, Ways, Relations and Tags) in an XML format. This is actually pointing your browser directly at the OpenStreetMap API to retrieve a bounding box of data (a map call). This has limitations in terms of the size and complexity of the data you can request. The XML data can be saved to a .osm file and filtered resp. opened within tools like Osmosis, osmfilter, or JOSM. To understand more about the XML format used, see Data Primitives.

Mapnik Image

Allows export of PNG, JPEG, SVG, PDF and PostScript maps in the OpenStreetMap 'standard' style (default layer of the map homepage) generated by the Mapnik rendering software.

These image export options are now found on the 'sharing' sidebar on the right

Embeddable HTML

Also on the 'sharing' sidebar on the right, you can get HTML. This option creates HTML code which you can copy and paste to use on any web page elsewhere on the web. The HTML fragment will embed the current map within an iframe, complete with javascript slippy map interface.

If you prefer to place a static map image on your website, simply take a screenshot and save the image file, or look at using the static map images services to embed one which will get updated.

Embeddable HTML with an added Marker

The steps to produce embeddable HTML with a marker to mark a specific location are as follows:

  • Go to http://www.openstreetmap.org
  • Navigate so that the view tab shows the area you are interested in
  • Click on the sharing button on the right
  • Fine tune the map view to ensure the area is still correct
  • Click on the "HTML" option"
  • Click on "Add a marker to the map"
  • Copy the text in the box in the Output section which starts <iframe

If you only wanted just a simple link to a map, the HTML is even more straightforward. Something like: <a href="http://www.openstreetmap.org/#map=9/31.23/30.05">View a map on OpenStreetMap</a> The URL within that HTML is a "permalink" to OpenStreetMap, with latitude and longitude parameters. See Browsing#Linking to Maps

If you have more sophisticated map embedding requirements e.g. showing more than one marker, or if you want to avoid using an iframe, then you will need to use HTML code which invokes a javascript 'slippy map' library under your own control. See Deploying your own Slippy Map

Other export formats and tools

See OSM on Paper for another list of tools (including easy to use webinterfaces)

If you need a different format, see below. You will usually need to download the data you require as OpenStreetMap XML Data (.osm), either from the 'Export' tab (small areas) or Planet.osm (large areas), then look at converting map data between formats. Ready-made downloads are available for some formats.

Bulk downloads

To download large quantities of OpenStreetMap data, see Planet.osm. If you then want to create your own webmap from this, see Deploying your own Slippy Map for some pointers.

Remember data may only be exported from OpenStreetMap (in any format) in accordance with the OpenStreetMap License.