1
ESRI Shape 文件技术说明书
ESRI 白皮书—1998 年 7 月
初译:yzg
2006年5月4日
2
注意:本人非英语、计算机及 GIS 专业从业人员,翻译此文仅供参考之用。
受本人水平所限,出现错误之处实属正常,如有有心人能给予指正,将不胜感激。
2006 年 5 月 4 日
YZG
3
ESRI Shapefile 技术说明书
ESRI 白皮书
Contents page
Why Shapefiles? 1
Shapefile Technical Description 2
Organization of the Main File 3
Main File Record Contents 5
Organization of the Index File 5
Organization of the dBASE File 18
Glossary 20
1
ESRI Shapefile 技术说明书
This document defines the shapefile(.shp)spatial data format and describes why shapefiles are
important. It lists the tools available in Environmental Systems Research Institute,
Inc.(ESRI),software for creating shapefiles directly or converting data into shapefiles from other
formats. This document also provides all the technical information necessary for writing a
computer program to create shapefiles without the use of ESRI
®
software for organizations that
want to write their own fata translators.
Why Shapefiles?
A shapefile stores nontopological geometry and attribute information for the spatial features in a
data set. The geometry for a feature is stored as a shape comprising a set of vector coordinates.
Because shapefiles do not have the processing overhead of a topological data structure, they
have advantages over other data sources, such as faster drawing speed and edit ability.
Shapefiles handle single features that overlap or that are noncontiguous. They also typically
require less disk space and are easier to read and write.
Shapefiles can support point, line, and area features. Area features are represented as closed
loop, double-digitized polygons. Attributes are held in a dBASE
®
format file. Each attribute
record has a one-to-one relationship with the associated shape record.
如何创建 Shape 文件
Shape 文件可以通过以下四种方法建立:
■ 导出-可以通过 ARC/INFO、PC ARC/INFO、Spatial Database Engine
TM
(SDE
TM
)、
ArcView
®
GIS 或者 BusinessMAP
TM
software 等软件将任何源数据导出为 Shape 文件。
■ 数字化-可以使用 ArcView GIS 的要素创建工具,通过直接数字化的方法生成 Shape 文
件。
■ 编程-可以使用 Avenue
TM
(ArcView GIS) 、 MapObjects
TM
、 ARC Macro
Language(AML
TM
)(ARC/INFO)或者 Simple Macro Language(SML
TM
)(PC ARC/INFO)等开
发工具编程来创建 shape 文件。
■ 创建程序按照文件规范直接写 shape 文件。
SDE、ARC/INFO、 PC ARC/INFO、Data Automation Kit(DAK
TM
)以及 ArcCAD
®
等软件
均提供了 shape 向 coverage 的转换工具,ARC/INFO 也提供了 coverage 到 shape 的转换功
能。Shape 文件格式以白皮书的形式发布以便于与其它数据的交换。一些其它数据流,像
GPS 接收机的数据等等都可以存储为 shape 文件或 X、Y event tables。
2
Shapefile Technical Description
Shape 文件技术说明书
可以利用本文档中的说明书来创建计算机程序,用来读写 shape 文件。
ESRI 的 shape 文件由一个主文件、一个索引文件和一个 dBASE 表构成。主文件是
一个可变记录长度的随机文件,文件中的每个记录描述一个包含多个顶点的 shape。在索
引文件中,每个记录内容包含着与主文件中记录相对应的从主文件开始处的偏移量。
dBASE 表中包含着与每个要素相对应的一条要素属性记录。几何数据与属性的一一对应
关系是基于记录号来对应的。dBASE 文件中属性记录的顺序必须与主文件中的记录顺序
相同。
Naming Conventions
命名规则
所有的文件遵从 8.3 的命名规则。主文件、索引文件、dBASE 文件拥有相同的文件名。
文件名的开头字母必须是数字或字母(包括 a-Z、0-9),接下来是 0 到 7 个字符(包括
a-Z、0-9、_、-)。主文件的括展名为“.shp”,索引文件的括展名为“.shx”,dBASE 文
件的括展名为“.dbf”。对于区分大小写的操作系统,文件名要全部采用小写方式。
例
■ 主文件: counties.shp
■ 索引文件: counties.shx
■ dBASE 文件:counties.dbf
Numeric Types
数字类型
Shape 文件中存储着整数和双精度数,在接下来的文档内容中会提到以下的数据类型:
■ Integer: 有符号 32 位整数(4 字节)
■ Double: 有符号 64 位 IEEE 双精度浮点数(8 字节)
浮点数必须是数字值,正、负无穷大、非数字(NaN)值在 shape 文件中是不允许使
用的。不过,shape 文件支持“no data”值的概念,但在目前这也仅仅用于 measures。在
读取文件时,任何小于-10
38
的浮点数被认为是“no data”值。
在下面的第一个部分里首先描述 shape 文件的一般结构和组织形式。第二个部分描述
shape 文件所支持类型的记录内容。
- 1
- 2
- 3
前往页