文章摘要
GeoJSON是一种用于编码地理数据结构的格式,支持点、线、多边形等多种几何类型,并可通过Feature对象添加属性。2016年发布的RFC 7946成为其新标准规范,取代了2008年的旧版。
文章总结
GeoJSON地理数据格式简介
GeoJSON是一种用于编码各种地理数据结构的开放格式。它采用JSON(JavaScript对象表示法)格式来表示地理信息。
核心特性
GeoJSON支持以下基本几何类型: - 点(Point) - 线(LineString) - 多边形(Polygon) - 多点集合(MultiPoint) - 多线集合(MultiLineString) - 多多边形集合(MultiPolygon)
带有附加属性的几何对象称为"要素"(Feature),而要素集合则使用"要素集合"(FeatureCollection)对象来组织。
格式示例
json
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}
}
标准化进程
2015年,互联网工程任务组(IETF)与原规范作者共同成立了GeoJSON工作组(GeoJSON WG),旨在标准化这一格式。2016年8月发布的RFC 7946成为GeoJSON格式的新标准规范,取代了2008年的旧版规范。
(注:原文中的发布时间"Tue, 07 May 2019 15:34:25 GMT"与内容无关,已省略)
评论总结
以下是评论内容的总结:
正面评价
格式简洁易读
- "the format itself is great, and it allows for a relatively compact and relatively human-readable presentation" (评论1)
- "Much nicer than wrangling with binary formats like shapefiles" (评论7)
实用性强
- "GeoJSON is super useful... to draw polygons on zone maps and quickly generate rates" (评论2)
- "I’ve applied GeoJSON for mapping and monitoring tens of thousands of warehouse robots" (评论5)
工具支持广泛
- "vega-lite supports rendering of GeoJSON via 'geoshape'" (评论3)
- "geojson.io is a great editor/viewer by Mapbox" (评论13)
负面评价
性能问题
- "most parsers are horribly inefficient, which is tough, because a lot of geodata is massive" (评论12)
- "introduces a lot of bloat for really no benefit" (评论19)
功能限制
- "doesn’t even support z + m values at the same time" (评论10)
- "GeoJSON falls down is simplification of a group of polygons with common boundaries" (评论16)
坐标系问题
- "some tools fully assume this and will completely screw with calculations if you’re assuming a flatland CRS" (评论5)
- "Getting your CRSes wrong is fun..." (评论9)
替代方案
TopoJSON
- "TopoJSON solves this by encoding each such boundary only once" (评论16)
- "using topojson to add arcs... cut down on quite a bit of points to represent curves" (评论11)
GeoPackage
- "we recently switched to GeoPackage files, as it allows for different layers" (评论9)
- "GeoPackage... is not only more flexible but also much smaller" (评论10)
其他观点
非地理用途
- "GeoJSON is not just for geographical features! Shapes of any kind work just as well" (评论15)
开发背景
- "Made by Sean Gillies and a few others... when mapbox was doing all sorts of great open source stuff" (评论18)
工具推荐
- "I built https://geojson.page" (评论22)
- "https://geojson.io/... allows you to build GeoJSON graphically" (评论23)