Export

From OpenStreetMap Wiki
Jump to navigation Jump to search
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.

Export Menu

See also downloading data.

Use the export button in the top bar to open the export sidebar to get OpenStreetMap XML data for an area.

This will export all the current raw OpenStreetMap data (nodes, ways, relations - keys and tags) in an XML format. It does this by 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 or opened with tools like Osmosis, osmfilter, or JOSM. To understand more about the XML format used, see Data Primitives.

Other Formats

If the above export fails, it might be because the area you are trying to export is too large. In that case, you can try to download the data in smaller chunks or use one of the following alternatives:

  • Overpass API - A platform for querying OpenStreetMap data in real-time. It allows you to extract custom data in various formats.
  • Planet.osm - Regularly updated copies of the complete OpenStreetMap database.
  • Geofabrik Downloads - Regularly updated extracts of continents, countries, and selected cities.

Share Menu

Use the share button at the side of the map to open the share sidebar to get a link to the current view, an embeddable HTML snippet, or a rendered image of the current view.

Link or HTML

Links to the Map

The 'Share' sidebar on the right has a 'link' option that gives you a URL for the current view. This is a 'permalink' to the OpenStreetMap website, with latitude and longitude parameters. You can copy and paste this URL to share the current view with others.

You also have the ability to place a marker to indicate a specific location on the map. Select the Include marker checkbox and move the marker to the desired location. The URL will be updated to include the marker's location.

A shortened version of the URL is also available by clicking on the Short Link button.

Embeddable HTML

The 'HTML' option allows you to create an embeddable HTML snippet.

Select HTML to get an HTML code snippet 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.

Geo URI

The Geo URI is a standard for encoding a location as a string of text. This is useful for sharing a location with other applications. The Geo URI is a link that can be opened in a mapping application on a mobile device or in a web browser.

Image

The last option in the 'Share' sidebar is to create an image of the current view.

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

The scale will determine the level of detail in the exported images.

By default, the exporter will use the current view of the map, but you can also specify a bounding box by selecting the Set custom dimensions option. You can then change the bounding box by dragging the corners of the box on the map.

Other Export Formats and Tools

See OSM on Paper for another list of tools (including easy-to-use web interfaces).

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.

If you only wanted just a simple link to a map, the HTML is even more straightforward. Something like: <a href="https://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.

Why Does the 'Export' Feature Sometimes Not Work?

When the rendering servers have a high load from traffic to the main map, some of the exports get temporarily disabled. This is because the rendering of custom images from the export tab takes a lot of resources compared to the slippy map.

If you want to use the exports, you can try again later or see other alternatives.

Bulk Downloads

To download large quantities of OpenStreetMap data, see Planet.osm. If you then want to create your own web map 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.