OSM (.osm)
- Import fully supports the XML version of the OSM format.
Background & Context
-
- Vector map format.
- Commonly used to store and distribute vector geo primitives for map rendering.
- XML-based text format. A binary form is also available, based on PBF.
- It saves data in the form of "nodes" (points), "ways" (connections) and "relations" (properties).
- OSM is an acronym derived from OpenStreetMap.
- Developed by the OpenStreeMap project.
Import
- Import["file.osm"] imports the data associated to the vector geo primitives stored in the given file.
- Import["file.osm",elem] imports the specified element from a OSM file.
- Import["file.osm",{{elem1},{elem2},…}}] imports multiple elements.
- The import format can be specified with Import["file","OSM"] or Import["file",{"OSM",elem,…}].
- See the following reference pages for full general information:
-
Import import from a file CloudImport import from a cloud object ImportString import from a string ImportByteArray import from a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Data representation elements:
-
"Data" graphics primitives for each layer "Graphics" all layers combined into a single graphics object "GraphicsList" list of graphics representing the layers of an OSM archive - Import by default uses the "Graphics" element for the OSM format.
- Import["file","Data"] returns an expression of the form {layer1,layer2,…} . Individual layers are given as a list of rules representing the geometry, as well as numerical and textual information associated with the features.
- Metainformation elements:
-
"LayerNames" all layer names, given as a list of strings "LayerTypes" what graphics primitives comprise each layer "SpatialRange" range of geographic coordinates, typically given in decimal degrees - Elements representing the geodetic datum and reference ellipsoid used in the file:
-
"CoordinateSystem" name of the coordinate system used in the file "Datum" geodetic datum "SemimajorAxis" semimajor axis of the reference ellipsoid "SemiminorAxis" semiminor axis of the reference ellipsoid "InverseFlattening" inverse flattening of the ellipsoid "LinearUnits" coordinate system units - Elements specifying the cartographic projection and its parameters:
-
"Projection" projection name and parameters "Centering" latitude and longitude defining the origin of the projection "StandardParallels" standard parallels "CentralScaleFactor" scale factor at the central meridian or center of projection "GridOrigin" grid coordinates {n,e} of the central parallel and meridian "ProjectionName" Wolfram Language standard name of the projection used "ReferenceModel" what reference sphere or ellipsoid to use - Accessing low-level metainformation from the file:
-
"CoordinateSystemInformation" raw parameters of the coordinate system as stored in the file - See the reference page for GeoProjectionData for full information on cartographic projections.
Options
- General rendering options:
-
GeoBackground Automatic background style ImageSize Automatic overall size of the image
Examples
open allclose allImport Elements (21)
Data Representation (3)
"Graphics" (1)
Import the full set of graphics primitives and represent them using GeoGraphics. This is the default:
Metadata (3)
Datum and Reference Ellipsoid (6)
"CoordinateSystem" (1)
Name of the cartographic coordinate system, with None representing unprojected data: