SHP (.shp)

  • Import fully supports the SHP format.

BackgroundBackground

    ESRI shape file format.
    Common GIS file format.
    Used for archiving and exchanging cartographic and geospatial information.
    Stores the geometry and data of map features.
    SHP is an acronym derived from the word Shape.
    A SHP bundle consists of multiple files combined in a file archive or directory.
    Binary format.

Import and ExportImport and Export

  • Import["dir","SHP"] or Import["dir"] imports an entire SHP directory and returns a combined rendering of all graphics layers.
  • The Wolfram Language can read SHP files from directories or file archive bundles.
  • Import["dir/file.shp"] imports the specified layer from a shape file bundle.
  • Import["dir"] returns a GeoGraphics object.
  • Import["dir","elem"] imports the specified element from an SHP file.
  • Import["dir",{{"elem1","elem2",}}] imports multiple elements.
  • See the reference pages for full general information on Import.

ElementsElements

  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Graphics"all layers combined into a single graphics object
    "GraphicsList"list of graphics representing the layers of an SHP archive
    "Data"graphics primitives for each layer
  • Import by default uses the element for the SHP format.
  • Import["file","Data"] returns an expression of the form . Individual layers are given as a list of rules representing the geometry as well as numerical and textual information associated with the features.
  • Meta-information 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 in meters
    "SemiminorAxis"semiminor axis of the reference ellipsoid in meters
    "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 of the central parallel and meridian
    "ProjectionName"Wolfram Language standard name of the projection used
    "ReferenceModel"which reference sphere or ellipsoid to use
  • Accessing low-level meta-information 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.

OptionsOptions

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Import all layers from an SHP bundle:

In[1]:=
Click for copyable input
Out[1]=

Import the layer names:

In[2]:=
Click for copyable input
Out[2]=

Show a list of all import elements available for this file:

In[3]:=
Click for copyable input
Out[3]=

Import the name of the geodetic datum to which the coordinates in the file are referenced:

In[4]:=
Click for copyable input
Out[4]=

The coordinates in this file are not projected:

In[5]:=
Click for copyable input
Out[5]=
Introduced in 2008
(7.0)