Shapefile

Shapefile

Infobox file format
name = Shapefile
icon =


caption = A vector map, with points, polylines and polygons.
extension = .shp, .shx, .dbf
mime =
typecode =
uniform type =
magic =
genre = GIS
containerfor =
containedby =
owner = ESRI
extendedfrom =
extendedto =
standard = [http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf Shapefile Technical Description]

The ESRI Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by ESRI as a (mostly) open specification for data interoperability among ESRI and other software products.cite paper |author=Environmental Systems Research Institute, Inc. |title=ESRI Shapefile technical description |date=July, 1998 |url=http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf |accessdate=2007-07-04 ] A "shapefile" commonly refers to a collection of files with ".shp", ".shx", ".dbf", and other extensions on a common prefix name (e.g., "lakes.*"). The actual "shapefile" relates specifically to files with the ".shp" extension, however this file alone is incomplete for distribution, as the other supporting files are required.

Shapefiles spatially describe geometries: points, polylines, and polygons. These, for example, could represent water wells, rivers, and lakes, respectively. Each item may also have attributes that describe the items, such as the "name" or "temperature".

Overview

A shapefile is a digital vector storage format for storing geometric location and associated attribute information. This format lacks the capacity to store topological information. The shapefile format was introduced with ArcView GIS version 2 in the beginning of the 1990s. It is now possible to read and write shapefiles using a variety of free and non-free programs.

Shapefiles are simple because they store primitive geometrical data types of points, lines, and polygons. These primitives are of limited use without any attributes to specify what they represent. Therefore, a table of records will store properties/attributes for each primitive shape in the shapefile. Shapes (points/lines/polygons) together with data attributes can create infinitely many representations about geographical data. Representation provides the ability for powerful and accurate computations.

While the term "shapefile" is quite common, a "shapefile" is actually a set of several files. Three individual files are normally mandatory to store the core data that comprises a shapefile. There are a further eight optional files which store primarily index data to improve performance. Each individual file should conform to the MS DOS 8.3 filenameing convention (8 character filename prefix, fullstop, 3 character filename suffix such as shapefil.shp) in order to be compatible with past applications that handle shapefiles. For this same reason, all files should be located in the same folder.

Mandatory files :
* .shp — shape format; the feature geometry itself
* .shx — shape index format; a positional index of the feature geometry to allow seeking forwards and backwards quickly
* .dbf — attribute format; columnar attributes for each shape, in dBase III format

Optional files :
* .prj — projection format; the coordinate system and projection information, a plain text file describing the projection using well-known text format
* .sbn and .sbx — a spatial index of the features
* .fbn and .fbx — a spatial index of the features for shapefiles that are read-only
* .ain and .aih — an attribute index of the active fields in a table or a theme's attribute table
* .ixs — a geocoding index for read-write shapefiles
* .mxs — a geocoding index for read-write shapefiles (ODB format)
* .atx — an attribute index for the .dbf file in the form of "shapefile"."columnname".atx (ArcGIS 8 and later)
* .shp.xml — metadata in XML format

In each of the .shp, .shx, and .dbf files, the shapes in each file correspond to each other in sequence. That is, the first record in the .shp file corresponds to the first record in the .shx and .dbf files, and so on. The .shp and .shx files have various fields with different endianness, so as an implementor of the file formats you must be very careful to respect the endianness of each field and treat it properly.

Shapefiles deal with coordinates in terms of X and Y, although they are often storing longitude and latitude, respectively. While working with the X and Y terms, be sure to respect the order of the terms (longitude is stored in X, latitude in Y).

Shapefile shape format (.shp)

The main file (.shp) contains the primary geographic reference data in the shapefile. The file consists of a single fixed length header followed by one or more variable length records. Each of the variable length records includes a record header component and a record contents component. A detailed description of the file format is given in the "ESRI Shapefile Technical Description". This format should not be confused with the AutoCAD shape font source format, which shares the .shp extension.

The main file header is fixed at 100 bytes in length and contains 17 fields; nine 4-byte (32-bit unsigned integer or uint32) integer fields followed by eight 8-byte (double) floating point fields:

The variable length record contents depend on the shape type. The following are the possible shape types:

In common use, shapefiles containing Point, Polyline, and Polygon are extremely popular. The "Z" types are three-dimensional. The "M" types contain a user-defined measurement which coincides with the point being referenced. Three-dimensional shapefiles are rather uncommon, and the measurement functionality has been largely superseded by more robust databases used in conjunction with the shapefile data.

Shapefile shape index format (.shx)

The shapefile index contains the same 100-byte header as the .shp file, followed by any number of 8-byte fixed-length records which consist of the following two fields:

Using this index, it is possible to seek backwards in the shapefile by seeking backwards first in the shape index (which is possible because it uses fixed-length records), reading the record offset, and using that to seek to the correct position in the .shp file. It is also possible to seek forwards an arbitrary number of records by using the same method.

Shapefile attribute format (.dbf)

Attributes for each shape are stored in the xBase (dBase) format, which has an [http://www.clicketyclick.dk/databases/xbase/format/ open specification] .

Shapefile projection format (.prj)

The projection information contained in the .prj file is critical in order to understand the data contained in the .shp file correctly. Although it is technically optional, it is most often provided, as it is not necessarily possible to guess the projection of any given points. Some typical information contained in the .prj file is:

* Geographic coordinate system
* Datum (geodesy)
* Spheroid
* Prime meridian
* Map projection
* Units used
* Parameters necessary to use the map projection, for example:
** Latitude of origin
** Scale factor
** Central meridian
** False northing
** False easting
** Standard parallels

Shapefile spatial index format (.sbn)

This is a binary spatial index file, which is used only by ESRI software. The format is not documented, and is not implemented by other vendors. The .sbn file is not strictly necessary, since the .shp file contains all of the information necessary to successfully parse the spatial data.

Limitations

Topology and shapefiles

Shapefiles do not have the ability to store topological information. ArcInfo coverages and Personal/File/Enterprise Geodatabases do have the ability to store feature topology.

Spatial representation

The edges of a polyline or polygon are defined using points, which can give it a jagged edge at higher resolutions. Additional points are required to give smooth shapes, which requires storing quite a lot of data compared to, for example, bézier curves, which can capture complexity using smooth curves, without using as many points. Currently, none of the shapefile types support bézier curves.

Data storage

Unlike most databases, the database format is based on older xBASE standard, incapable of storing null values in its fields. This limitation can make the storage of data in the attributes less flexible. In ArcGIS products, values that "should" be null are instead replaced with a 0 (without warning), which can make the data misleading. This problem is addressed in ArcGIS products by using ESRI's Personal Geodatabase offerings, one of which is based on Microsoft Access.

Mixing shape types

Each shape file can technically store a mix of different shape types, as the shape type precedes each record, but common use of the specification dictates that only shapes of a single type can be in a single file. For example, a shape file cannot contain both Polyline and Polygon data. Thus, well (point), river (polyline) and lake (polygon) data must be kept in three separate files.

References

External links

* [http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?id=2729&pid=2727&topicname=Shapefile_file_extensions Shapefile file extensions] - ESRI Webhelp docs for ArcGIS 9.2 (2007)
* [http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf ESRI Shapefile Technical Description] - ESRI White Paper, July 1998
* [http://www.esri.com/news/arcuser/0401/topo.html ESRI - Understanding Topology and Shapefiles]
* [http://shapelib.maptools.org/ shapelib] - Shapefile C Library
* [http://www.gdal.org/ogr/ OGR] - The Open Source OGR library for handling many vector formats (e.g. shapefiles, Google Earth KML, GML, GRASS, GMT, PostGIS, etc.)
* [http://www.qarah.com/shapeviewer/ Shape Viewer] - A free shapefile viewer for Windows
* [http://www.mapshaper.org/ MapShaper] - A free online shapefile editor and simplifier
* [http://www.tatukgis.com/products/viewer/viewer.aspx TatukGIS] - A free shapefile viewer that opens most GIS/CAD and raster image file types


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Shapefile — Mapa vectorial con polilíneas, puntos y polígonos. Desarrollador ESRI …   Wikipedia Español

  • Shapefile — Carte vectorielle simple Extension .shp, .shx, .dbf Développé par ESRI …   Wikipédia en Français

  • Shapefile — Das Dateiformat Shapefile (oft Shapedaten oder Shape genannt) ist ein von ESRI ursprünglich für ArcView entwickeltes Format für Geodaten. Es hat sich mittlerweile zu einer Art Quasi Standard im Desktop GIS Umfeld verbreitet, da es ein recht… …   Deutsch Wikipedia

  • Shapefile — «Шейп файл» Векторная карта с точками, ломаными и полигонами. Расширение …   Википедия

  • SHX — Das Dateiformat Shapefile (oft Shapedaten oder Shapes genannt) ist ein von ESRI ursprünglich für ArcView entwickeltes Format für Geodaten. Es hat sich mittlerweile zu einer Art Quasi Standard im Desktop GIS Umfeld verbreitet, da es ein recht… …   Deutsch Wikipedia

  • Shapedaten — Das Dateiformat Shapefile (oft Shapedaten oder Shapes genannt) ist ein von ESRI ursprünglich für ArcView entwickeltes Format für Geodaten. Es hat sich mittlerweile zu einer Art Quasi Standard im Desktop GIS Umfeld verbreitet, da es ein recht… …   Deutsch Wikipedia

  • Shx — Das Dateiformat Shapefile (oft Shapedaten oder Shapes genannt) ist ein von ESRI ursprünglich für ArcView entwickeltes Format für Geodaten. Es hat sich mittlerweile zu einer Art Quasi Standard im Desktop GIS Umfeld verbreitet, da es ein recht… …   Deutsch Wikipedia

  • Comparison of Vector Formats (GIS) — The following tables compare general and technical information for a number of vector GIS file formats. Please see the individual products articles for further information. This article is not all inclusive or necessarily up to date. Unless… …   Wikipedia

  • Liste der Dateiendungen/S — In dieser Liste sind übliche Dateinamenserweiterungen aufgelistet, die in einigen Betriebssystemen (wie zum Beispiel Microsoft Windows) zur Unterscheidung von Dateiformaten verwendet werden. In anderen Betriebssystemen erfolgt die… …   Deutsch Wikipedia

  • GeoServer — GeoNetwork con una aplicación web Desarrollador OpenGeo, GeoSolutions, Refract …   Wikipedia Español

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”