- A main file (*.shp)
- An index file (*.shxd)
- A DataBase table (*.dbf)
The main file is a direct access, variable-record-length file in which each record describes a shape with a list of its verticies.
In the index file, each record contains the offset of the corresponding main file record from the beginning of the main file.
The dBASE table contains feature attributes with one record per feature. The one-to-one relationship between geometry and attributes is based on record number.
** The main file (.shp) contains a fixed-length file header followed by variable-length records. Each variable-length record is made up of a fixed-length record header followed by variable-length record contents.
The header for each record stores the record number and content length for the record.Record headers have a fixed length of 8 bytes.
Shapefile record contents consist of a shape type followed by the geometric data for the shape. The length of the record contents depends on the number of parts and verticies in a shape. For each shape type, we first describe the shape and then its mapping to record contents on disk.
Shapes are from simple "Points" till Multiple Polygons. (Detailed description of record structures and tables can be found in the reference document)
** The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records.
The index file header is identical in organization to the main file header.
The I’th record in the index file stores the offset and content length for the I’th record in the main file.
** The dBASE file (.dbf) contains any desired feature attributes or attribute keys to which other tables can be joined. Its format is a standard DBF file used by many table-based applications in Windows™ and DOS.
For more information on the dBASE file format, visit http://www.inprise.com/
Ref: http://svn2.assembla.com/svn/boogy/eBooks/shapefile.pdf (use your SVN password)
