ESRI shapefiles
Encyclopedia : E : ES : ESR : ESRI shapefiles
The ESRI Shapefile is a proprietary data-type used in many Geographic Information Systems software products. It was originated by ESRI primarily for use with their product ArcView. ESRI established the shapefile format. Many non-ESRI products may use the shapefile format; however they still have to meet the format established by ESRI if they wish to use the term shapefile properly.
- 1 Overview
- 2 Topology and Shapefiles
- 3 File Viewers
- 4 File Converters
- 5 File components
- 5.1 .shp file format (main file)
- 5.2 .shx file format
- 5.3 .dbf file format
- 5.4 .sbn file format
- 5.5 .sbx file format
- 5.6 .fbn file format
- 5.7 .fbx file format
- 5.8 .ain file format
- 5.9 .aih file format
- 5.10 .prj file format
- 5.11 .shp.xml file format
- 5.12 .atx file format
- 6 References
- 7 External links
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 is primarily created and used by ArcView GIS. Shapefiles can also be used and created in ARC/INFO, ArcGIS and other widely used GIS software. [link]Shapefiles are very powerful because they store primitive geometrical data types of Points, Lines and Polygons. Alone, these primitives are relatively useless without any attributes to specify what the primitives 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.
Topology and Shapefiles
Shapefiles do not have the ability to store topological information. ArcINFO coverages and Personal/Enterprise Geodatabases do have the ability to store feature topology.
File Viewers
Clearly the full featured GIS products from ESRI support the Shapefile format and ESRI also has some basic standalone viewer software, however there are numerous freeware, shareware and commercial products which provide core shapefile viewer capability. Cimmetry Systems provides a viewer ESRI-view in it Autovue product.File Converters
R2V is a coverter for converting Raster Images (jpeg, gif, bmp) to ShapeFiles. ( [[User:203.215.177.101|203.215.177.101]] Muhammad Haris.)File components
While a Shapefile must be considered as a whole, a "Shapefile" is actually a set of files. Three individual files are mandatory and these store the core data. There are a further 8 optional individual files which store primarily index data to improve performance. Each individual file must conform to the MS DOS 8.3 naming convention (8 character filename prefix, fullstop, 3 character filename suffix such as shapefil.shp). All files in the set must be located in the same folder.Mandatory files :
- .shp - the file that stores the feature geometry
- .shx - the file that stores the index of the feature geometry
- .dbf - the dBASE, or database, file that stores the attribute information of features
- .sbn and .sbx - store the spatial index of the features
- .fbn and .fbx - store the spatial index of the features for shapefiles that are read-only
- .ain and .aih - store the attribute index of the active fields in a table or a theme's attribute table
- .prj - the file that stores the coordinate system information
- .shp.xml - metadata for the shapefile
- .atx - attribute index for the .dbf file in the form of
. .atx (ArcGIS 8 and later)
.shp file format (main file)
The main file (.shp) contains the primary 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.
The main file header is fixed at 100 bytes in length and contains 17 fields (9 x 4 bytes and 7 x 8 bytes) with data for the File Code (9994), Unused / Reserved, File Length, Version Number, Shape Type and Bounding Box (minimum and maximum values for X, Y, Z, M).
The variable length record header is fixed at 8 bytes in length and simply contains 2 fields with data for record number and content length.
The variable length record contents depend entirely upon the Shape Type (included in the main file header) for which there is a one to one correspondence. Each shape type and its detailed
- Null Shape (Value : 0) - 1 Field 1 Byte - essentially a holder for future data
- Point (Value : 1) - 3 Fields (Shape Type, X, Y) - 20 Bytes
- Polyline (Value : 3) - 6 Fields (Shape Type, Box, NumParts, NumPoints, Parts, Points) - 44+4*NumParts Bytes
- Polygon (Value : 5) - 6 Fields (Shape Type, Box, NumParts, NumPoints, Parts, Points) - 44+4*NumParts Bytes
- MultiPoint (Value : 8) - 4 Fields (Shape Type, Box, NumPoints, Points)
- PointZ (Value : 11) - 5 Fields (Shape Type, X, Y, Z, Measure)
- PolylineZ (Value : 13) - 9 Mandatory fields (Shape Type, Box, NumParts, NumPoints, Parts, Points, Zmin, Zmax, Zarray) + 3 Optional Fields (Mmin, Mmax, Marray)
- PolygonZ (Value : 15) - 9 Mandatory fields (Shape Type, Box, NumParts, NumPoints, Parts, Points, Zmin, Zmax, Zarray) + 3 Optional Fields (Mmin, Mmax, Marray)
- MultiPointZ (Value : 18) - 7 Mandatory fields (Shape Type, Box, NumPoints, Points, Zmin, Zmax, Zarray) + 3 Optional Fields (Mmin, Mmax, Marray)
- PointM (Value : 21) - 4 Fields (Shape Type, X, Y, M) - Bytes
- PolylineM (Value : 23) - 6 Mandatory fields (Shape Type, Box, NumParts, NumPoints, Parts, Points) + 3 Optional Fields (Mmin, Mmax, Marray)
- PolygonM (Value : 25) - 6 Mandatory fields (Shape Type, Box, NumParts, NumPoints, Parts, Points) + 3 Optional Fields (Mmin, Mmax, Marray)
- MultiPointM (Value : 28) - 4 Mandatory Fields (Shape Type, Box, NumPoints, Points) + 3 Optional Fields (Mmin, Mmax, Marray)
- MultiPatch (Value : 31) - 10 Mandatory fields (Shape Type, Box, NumParts, NumPoints, Parts, PartTypes, Points, Zmin, Zmax, Zarray) + 3 Optional Fields (Mmin, Mmax, Marray)
.shx file format
.dbf file format
.sbn file format
Part of ArcView's spatial index. In case this file is outdated, ArcView will not display the shapefile correctly. It will appear like a lot of features have been deleted. To recreate the spatial index in ArcView, do the following:- Go to the table
- Select the Shape field
- Select Field->Remove Index from the menu
- Select Field->Create Index from the menu
- Right click on the shapefile and choose properties
- Click the indexes tab
- At the bottom, choose Delete to remove the index
- At the bottom, choose add to recreate the index
.sbx file format
.fbn file format
.fbx file format
.ain file format
.aih file format
.prj file format
PRJ file is a TEXT file that contains the string explaining the projections used. Sample:PROJCS["NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",8202099.737532808],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-120.5],PARAMETER["Standard_Parallel_1",44.33333333333334],PARAMETER["Standard_Parallel_2",46.0],PARAMETER["Latitude_Of_Origin",43.66666666666666],UNIT["Foot",0.3048]]
.shp.xml file format
.atx file format
References
[1] USGS Coastal & Marine Geology InfoBankExternal links
- [ESRI Shapefile Technical Description, ESRI White Paper, July 1998]
- [ESRI - Understanding Topology and Shapefiles]
- [Shapefile Examples]
- [Shapefile C Library]
- [Cimmetry Systems, Autovue, ESRI Viewer software]
- [ESRI ArcGIS 9 Extension KMLer] ESRI ArcGIS 9 Extension to convert shapefiles to Google Earth KML files]
- [free viewer]
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
