Questions tagged [shapefile]

A vector data storage format for storing the location, shape, and attributes of geographic features. Often referred to as 'an ESRI shapefile', as ESRI developed it.

Each shapefile can describe a set of either points, lines or polygons, but not a mix of different types. A shapefile is actually a collection of related files with the same prefix but different file extensions.

Each shapefile can describe one or more features, which are individual units (points, lines or polygons) within it.

At a minimum each shapefile has three files:

  • .shp: the geometry, with descriptions of each feature;
  • .shx: the 'index file' for the geometry which points to the beginning of each feature within the .shp file;
  • .dbf: a database file (in dBase IV format) which has one row for each feature and fields describing characteristics of each.

Shapefiles may have any number of other files associated with them. For example, .prj files are often attached which contain information about the projection of the file, or .sbn and .sbx which are another kind of spatial index.

ESRI GIS Dictionary.: "... A shapefile is stored in a set of related files and contains one feature class."

Other component files follows:

  • .sbn: part 1 of spatial index for read-write instances of the Shapefile format.
  • .sbx: part 2 of spatial index for read-write instances of the Shapefile format.
  • .fbn: one of the files that store the spatial index of the features for instances of the Shapefile format that are read-only.
  • .fbx: the other file (besides .fbn) that stores the spatial index of the features.
  • .ain: one of the files that stores the attribute index of the active fields in a table or a theme's attribute table.
  • .aih: the other file (besides .ain) that stores the attribute index of the active fields.
  • .ixs: geocoding index for read/write shapefiles.
  • .prj: projections definition file; stores coordinate system information.
  • .xml: contains metadata, as used by ArcGIS.
  • .cpg: an optional file that can be used to specify the codepage for identifying the character set to be used.
5590 questions
32
votes
6 answers

"Oddities" in the Shapefile technical specification

I've been writing a shapefile parsing library, and have encountered a couple of design decisions in the specification that I don't immediately understand. I'm hoping there's a wizened old ESRI developer around here who can tell me why these things…
canisrufus
  • 2,474
  • 1
  • 18
  • 30
10
votes
3 answers

Polygon shapefile with null values?

Does anyone know where I can find a sample shapefile that has null entries in it (preferably a polygon shapefile)? I'm not sure how to create one with null entries.
Jeff Storey
  • 1,067
  • 1
  • 11
  • 17
6
votes
2 answers

How is attribute data in DBF file tied to shapefile location data in SHP file?

I opened a DBF file in Excel and I'm looking at attribute data from a shapefile export. How is the row of attribute data in the DBF file connected to it's corresponding locational data in the SHP file? I don't see anything that looks like a key.
DenaliHardtail
  • 3,177
  • 4
  • 34
  • 68
6
votes
2 answers

What versions of dBase do shapefiles support?

I have been looking around like crazy, not finding any specification which versions of dBase shapefiles support (ESRI shapefiles). I found that GeoTools uses dBase III only, and Wikipedia says dBase IV only. I'm writing a reader, how should I decide…
Johan S
  • 393
  • 1
  • 3
  • 12
6
votes
1 answer

Are polygons stored clockwise or counterclockwise in a shapefile?

I'm working with polygon coordinates in QGIS using PyQGIS using ESRI shapefiles as input data. Are the polygon vertices (I am referring only to the outer boundary in the case of polygons with holes) stored as clockwise or as counterclockwise in a…
jgpallero
  • 749
  • 2
  • 8
  • 17
5
votes
4 answers

We sent client Esri files and now they want to see polygons

We are a voter list company. Every ten years new political boundaries are written for federal and state offices. All of the corresponding shapefiles are ESRI ready. One of our clients is getting voter data from us and wanted to supplement it with…
5
votes
5 answers

Do 1KB Shapefiles with bigger .shp.xml contain any usable data?

I received this folder from a county's GIS department. Am I right in telling them that there is nothing in it? They seem convinced that everything is included, but all I see is that there is Metadata associated with the Shapefile that isn't…
H. Rigsby
  • 141
  • 1
  • 8
4
votes
1 answer

Why do I need to know what "endianness" is?

I'm just learning about GIS and shapefiles. I am a total newb right now. I'm probably going to get into some SQL Spatial stuff and I'm just reading about what shapefiles are. I keep on seeing a lot about endianness. I realize it has something to…
webdad3
  • 157
  • 6
2
votes
0 answers

Shapefiles for all the individual countries in the world

I'm searching for shapefiles that I can later convert into SVG (with something like kartograph.py). Essentially I'm just looking for the outline with (if possible) a dot where the capital is on the map. Is there anywhere that I can download them…
Dan
  • 31
  • 1
  • 3
2
votes
1 answer

Shapefile string data max length and character

Does anyone know why in ESRI help website (1, 2), it states that the field length if not specified will default to 255. However when I manually create a shapefile the max character is only 254. Why is there this difference of 1 character?
terrty
  • 21
  • 1
2
votes
0 answers

Shapefile will not load in QGIS but does in ArcGIS

Using QGIS version 3.14.0-Pi on Windows 10. I'm trying to download a shapefile (Layer, Create Layer, New Shapefile layer). In the resulting dialog I use: File encoding UTF-8, Geometry type "Polygon" Add. dimensions EPSG:4269 - NAD83. The original…
2
votes
1 answer

How would you explain what a shapefile is?

How would you explain what a shapefile is to someone who is not already a GIS-professional but is interested in learning more? Shapefiles are one of the most common GIS data storage formats. However shapefiles are as I have understood not really a…
Jesper Hybel
  • 123
  • 6
2
votes
1 answer

Can I delete ".shp.xml" without affecting the shapefile's data?

The size of my ".shp.xml" file is 100 MB. 1) What is the purpose of the ".shp.xml" file? 2) Can I delete this file without affecting the data?
Comrade Che
  • 7,091
  • 27
  • 58
2
votes
3 answers

Multi-geometry shapefiles

Since a shapefile can only contain a single geometry type (e.g. point, polygon, etc), how could I persist both? If I must create a shapefile for each geometry type, how can I pass them to a colleague to load? In kml I can just pass the single kml…
Credible Holk
  • 21
  • 1
  • 3
2
votes
3 answers

Creating shapefile without ArcGIS Desktop?

I have to create a shapefile but I do not have access to ArcGIS Desktop, only to ArcExplorer, which will not allow me to create a shapefile. What other way can I do this? I have GRASS but am not familiar with it.
rkc1316
  • 93
  • 1
  • 5
1
2 3 4