OpenLayer4——GeoJSON简介
GeoJSON实际上就是一个JSON,为了满足GIS编程需要,额外定制了这样一套规则。
geojson中包含了点、线、面的数据,包含大量的坐标的数组
(不需要背诵记忆,如果参与GIS编程,短时间内就会接触大量这样的数据)
gsojson样例1
独立的feature
{"type":"Feature", "properties":{}, "geometry":{ "type":"Point", "coordinates":[105.380859375,31.57853542647338] } }
gsojson样例2
feature集合
{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }, { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]] }, "properties": { "prop0": "value0", "prop1": 0.0 } } ] }
GeoJSON成员变量
完整的GeoJSON,最外层往往是Feature或者FeatureCollection,Feature包含一个或多个Geometry,Geometry下面则是具体的几何数据(坐标数组和数据类型)。
GeoJSON
type:值必须是这些值其中一个:"Point","MultiPoint","LineString", "MultiLineString", "Polygon","MultiPolygon","GeometryCollection","Feature" 或者 "FeatureCollection”。
properties:携带参数,用于辅助图形绘制,并没有内容限制。(常见的比如:图形的名称、地图的样式)。
Geometry(几何图形,点、线、面图形数据)
Type:图形类型,分为Point、MultiPoint、LineString、MultiLineString、Polygon、MultiPolygon、GeometryCollection。
Coordinates:地图坐标数组
英文介绍
The GeoJSON object may have any number of members (name/value pairs).
The GeoJSON object must have a member with the name "type". This member's
value is a string that determines the type of the GeoJSON object.
The value of the type member must be one of: "Point", "MultiPoint",
"LineString", "MultiLineString", "Polygon", "MultiPolygon",
"GeometryCollection", "Feature", or "FeatureCollection". The case of the type
member values must be as shown here.
A GeoJSON object may have an optional "crs" member, the value of which must
be a coordinate reference system object .
A GeoJSON object may have a "bbox" member, the value of which must be a
bounding box array.
A geometry is a GeoJSON object where the type member's value is one of the
following strings: "Point", "MultiPoint", "LineString", "MultiLineString",
"Polygon", "MultiPolygon", or "GeometryCollection".
A GeoJSON geometry object of any type other than "GeometryCollection" must have
a member with the name "coordinates". The value of the coordinates member is
always an array. The structure for the elements in this array is determined by
the type of geometry.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
2018-03-28 Shiro(一)——极简配置