GIS

GIS Feature是什么

了解GIS中Feature(要素)的基本概念、组成、几何类型以及Feature与Geometry、属性和图层之间的关系。

阅读约 30 分钟

GIS Feature是什么

Feature(要素)是GIS矢量数据中的基本组成单位。

简单来说,一个Feature就是现实世界中的一个地理对象,例如:

  • 一栋建筑物
  • 一条道路
  • 一条河流
  • 一个城市
  • 一个公园
  • 一个监控点

Feature通常由**几何信息(Geometry)和属性信息(Attributes)**组成。

Feature由什么组成

一个GIS Feature通常可以理解为:

Feature
├── Geometry
│   ├── Point
│   ├── LineString
│   └── Polygon
│
└── Attributes
    ├── name
    ├── type
    └── value

其中:

  • Geometry描述地理对象的位置和形状
  • Attributes描述地理对象的名称、类型等信息

例如一个学校Feature:

Geometry
    Polygon
    ↓
学校所在区域

Attributes
    name = 第一小学
    type = 学校
    students = 1200

Feature与Geometry的区别

Geometry主要表示空间形状,而Feature是在Geometry基础上增加了属性信息的完整地理对象。

例如:

POINT (116.397 39.908)

这是一个Point Geometry。

如果增加属性:

name = 北京
type = 城市

就可以形成一个完整的Feature。

因此可以简单理解为:

Geometry
    ↓
描述在哪里、什么形状

Feature
    ↓
Geometry + Attributes
    ↓
完整的地理对象

Feature常见几何类型

GIS中最常见的Feature几何类型包括:

Point

点Feature通常用于表示一个具体位置。

例如:

  • 学校
  • 医院
  • 摄像头
  • 充电桩
  • 商店
POINT (116.397 39.908)

LineString

线Feature由多个坐标点连接形成。

例如:

  • 道路
  • 河流
  • 铁路
  • 管线
  • GPS轨迹
LINESTRING (
  116.397 39.908,
  116.405 39.915,
  116.412 39.920
)

Polygon

面Feature用于表示一个封闭区域。

例如:

  • 行政区
  • 建筑物
  • 地块
  • 湖泊
  • 公园
POLYGON ((
  116.390 39.900,
  116.400 39.900,
  116.400 39.910,
  116.390 39.910,
  116.390 39.900
))

Feature与属性

Geometry只能告诉我们一个对象在哪里。

属性信息则可以描述这个对象是什么。

例如道路Feature:

Geometry
    LineString

Attributes
    name = 长安街
    type = 城市主干道
    lanes = 8
    speed = 60

因此GIS数据通常同时包含:

空间信息
+
属性信息

这也是GIS区别于普通表格数据的重要特点。

Feature与Layer

实际GIS项目中通常不会只存在一个Feature。

例如一个道路图层可能包含:

道路Layer
├── Feature 1
├── Feature 2
├── Feature 3
├── Feature 4
└── ...

每个Feature代表一条具体道路。

因此可以理解为:

Map
 ↓
Layer
 ↓
多个Feature
 ↓
Geometry + Attributes

例如:

道路图层
├── 长安街
├── 建国路
├── 西长安街
└── 东三环

Feature与GeoJSON

GeoJSON是Web GIS中非常常见的矢量数据格式。

一个GeoJSON Feature通常类似:

{
  "type": "Feature",
  "id": 1,
  "geometry": {
    "type": "Point",
    "coordinates": [116.397, 39.908]
  },
  "properties": {
    "name": "北京",
    "type": "城市"
  }
}

其中:

type
    Feature

geometry
    几何信息

properties
    属性信息

多个Feature可以组成一个FeatureCollection:

FeatureCollection
├── Feature 1
├── Feature 2
├── Feature 3
└── ...

Feature与WKT

WKT主要用于描述Geometry。

例如:

POINT (116.397 39.908)
LINESTRING (
  116.397 39.908,
  116.405 39.915
)
POLYGON ((
  116.390 39.900,
  116.400 39.900,
  116.400 39.910,
  116.390 39.900,
  116.390 39.900
))

因此:

WKT
 ↓
主要描述Geometry

GeoJSON Feature
 ↓
Geometry + Properties

Feature有什么用

Feature是GIS空间分析的基础。

例如:

距离分析

计算两个Feature之间的距离。

医院Feature
      ↓
计算距离
      ↓
居民区Feature

缓冲区分析

围绕一个Feature创建一定范围的区域。

例如:

学校Feature
      ↓
500米缓冲区
      ↓
分析周边居民区

空间查询

例如查询:

哪些学校位于某个行政区内?

可以通过Feature之间的空间关系进行判断。

常见空间关系包括:

  • 相交
  • 包含
  • 相邻
  • 相离
  • 重叠
  • 相交于边界

Feature可以被编辑

GIS软件通常可以直接编辑Feature。

例如:

修改Geometry
    ↓
移动建筑
修改道路形状
修改行政区边界

也可以修改属性:

修改Attributes
    ↓
修改建筑名称
修改道路等级
修改人口数量

因此GIS编辑实际上主要包含:

Geometry编辑
+
Attribute编辑

Feature与矢量数据

Feature是矢量GIS数据的重要组成部分。

可以简单理解为:

矢量数据
    ↓
Layer
    ↓
Feature
    ↓
Geometry + Attributes

常见的矢量数据格式包括:

  • Shapefile
  • GeoJSON
  • GeoPackage
  • KML
  • GML

而WKT、WKB则更多用于Geometry的表示和交换。

总结

Feature是GIS中描述一个具体地理对象的基本单位。

最核心的关系是:

Feature
├── Geometry
│   ├── Point
│   ├── LineString
│   └── Polygon
│
└── Attributes
    ├── name
    ├── type
    └── value

可以记住:

Geometry描述对象在哪里以及是什么形状,Attributes描述对象是什么,而Geometry与Attributes结合后就形成了GIS中的Feature。

🧰

相关工具

使用 IYATools 在线工具快速处理 GIS 数据