meface/docs/article/db/shapefile.md

33 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Shapefile文件
date: 2020-09-11
author: ac
tags:
- Shapefile
categories:
- Database
---
## Shapefile
ESRI Shapefileshp或简称 shapefile是美国环境系统研究所公司ESRI开发的一种空间数据开放格式。
Shapefile 文件用于描述几何体对象折线与多边形仅仅能够存储几何体的位置数据没法存储地理数据的拓扑信息也无法在一个文件之中同时存储这些几何体的属性数据。所以Shapefile 还必须附带一个二维表用于存储 Shapefile 中每个几何体的属性信息。
Shapefile 文件指的是一种文件存储的方法,实际上该种文件格式是由多个文件组成的。
一个 Shapefile".shp", ".shx"与 ".dbf"三个文件是必不可少的。
- .shp文件主文件用于保存几何实体
- .shx文件索引文件保存每个记录包含对应主文件记录离主文件头开始的偏移
- .dbf文件dBASE表保存实体的属性信息
可选文件:
- .prj文件用于保存地理坐标系统与投影信息是一个存储 well-known text 投影描述符的文本文件。
- .shp.xml文件以XML格式保存元数据。
- .cpg文件用于描述 .dbf 文件的代码页,指明其使用的字符编码
> ArcGIS 10.2之后默认编码是utf-8desktop 能识别 utf-8的shape文件其它工具如QGIS默认是GBK编码所以会出现乱码的情况。