GeoJson介绍
GeoJson
GeoJson是Json数据(键值对),它是针对地理数据的一个变种
介绍
一个标准的GeoJson如下所示
{"type": "Feature","geometry": {"type": "Point","coordinates": [125.6, 10.1]},"properties": {"name": "Dinagat Islands"} }最外层:
- type:"Feature"表示一个特征要素,"FeatureCollection"表示为特征要素的集合
- geometry:存储该特征要素的实际形状描述
- properties:存储该要素的属性
geometry:
-
type:存储要素类型(Point(点),LineString,Polygon,MultiPoint(多点),MultiLineString(多线)和MultiPolygon(多面))
-
coordinates:坐标(存储图形坐标)
Feature
//点-Point {"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[105.380859375,31.57853542647338]} }//多点-MultiPoint {"type":"Feature","properties":{},"geometry":{"type":"MultiPoint","coordinates":[[105.380859375,31.57853542647338],[105.580859375,31.52853542647338]]} }// 线-LineString {"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":[[105.6005859375,30.65681556429287],[107.95166015624999,31.98944183792288],[109.3798828125,30.031055426540206],[107.7978515625,29.935895213372444]]} }// 多线-MultiLineString(3维数组) {"type":"Feature","properties":{},"geometry":{"type":"MultiLineString","coordinates":[[[105.6005859375,30.65681556429287],[107.95166015624999,31.98944183792288],[109.3798828125,30.031055426540206],[107.7978515625,29.935895213372444]],[[109.3798828125,30.031055426540206],[107.1978515625,31.235895213372444]]]} }//多边形-Polygon {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[106.10595703125,33.33970700424026],[106.32568359375,32.41706632846282],[108.03955078125,32.2313896627376],[108.25927734375,33.15594830078649],[106.10595703125,33.33970700424026]]]} }//多多边形-MultiPolygon(两个不相交的多边形) {"type": "Feature","properties": {},"geometry": {"type": "MultiPolygon","coordinates":[ [[[109.2041015625,30.088107753367257],[115.02685546875,30.088107753367257],[115.02685546875,32.7872745269555],[109.2041015625,32.7872745269555],[109.2041015625,30.088107753367257]]],[[[112.9833984375,26.82407078047018],[116.69677734375,26.82407078047018],[116.69677734375,29.036960648558267],[112.9833984375,29.036960648558267],[112.9833984375,26.82407078047018]]]]} }//多多边形-MultiPolygon(两个嵌套的多边形) {"type": "Feature","properties": {},"geometry": {"type": "MultiPolygon","coordinates":[ [[[101.6455078125,27.68352808378776],[114.78515624999999,27.68352808378776],[114.78515624999999,35.209721645221386],[101.6455078125,35.209721645221386],[101.6455078125,27.68352808378776]] ],[[[104.2822265625,30.107117887092357],[108.896484375,30.107117887092357],[108.896484375,33.76088200086917],[104.2822265625,33.76088200086917],[104.2822265625,30.107117887092357]]]]} }//多多边形-MultiPolygon(有孔洞的多边形) {"type": "Feature","properties": {},"geometry": {"type": "MultiPolygon","coordinates":[ [[[101.6455078125,27.68352808378776],[114.78515624999999,27.68352808378776],[114.78515624999999,35.209721645221386],[101.6455078125,35.209721645221386],[101.6455078125,27.68352808378776]],[[104.2822265625,30.107117887092357],[108.896484375,30.107117887092357],[108.896484375,33.76088200086917],[104.2822265625,33.76088200086917],[104.2822265625,30.107117887092357]]]]} }FeatureCollection
{"type": "FeatureCollection","features": [] }- features:可以存在多个feature,并且feature的种类可以不同
geometryCollection
只存图形
{"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [108.62, 31.02819]}, {"type": "LineString","coordinates": [[108.896484375,30.1071178870],[108.2184375,30.91717870],[109.5184375,31.2175780]]}] }总结
- 上一篇: 华硕(ASUS)TUF GAMING B
- 下一篇: sumo笔记(四)——路边停车,让司机休