参考链接:https://www.jianshu.com/p/852d7ad081b3
格式
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [125.6, 10.1] }, "properties": { "name": "Dinagat Islands" } }
geometry types:Point
, LineString
,Polygon
,MultiPoint
,MultiLineString
,MultiPolygon
.
Future集合使用FeatureCollection对象包含
{ "type": "FeatureCollection", "features": [ {
"type":"Feature", "properties":{}, "geometry":{ "type":"Point", "coordinates":[105.38085,31.57853] } } ] }
Point 对应的坐标是一维数组,里面是两个元素,如果是立体的坐标就是三维x,y,z;
[105.38085,31.57853]
MultiPoint
[ [105.380859375,31.57853542647338], [105.580859375,31.52853542647338] ]
LineString 线要素就是指线段,记录的是线的端点坐标,可视化时会按照记录顺序联结。对于曲线(如贝塞尔曲线)目前还没有很好的表达,但是在地理数据中,曲线一般会用LineString去拟合
[ [105.60058,30.65681], [107.95166,31.98944], [109.37988,30.03105], [107.79785,29.93589] ]
MultiLineString
[ [ [105.60058,30.65681], [107.95166,31.98944], [109.37988,30.03105], [107.79785,29.93589] ], [ [109.37988,30.03105], [107.19785,31.23589] ] ]
多边形Polygon 单个多边形是一个3维数组,可以包含多个二维数组,这种情况和MultiPolygon效果很像。
[ [ [106.10595,33.33970], [106.32568,32.41706], [108.03955,32.23138], [108.25927,33.15594], [106.10595,33.33970] ] ]
多多边形MultiPolygon
[ [ [ [109.20410,30.088107], [115.02685,30.08810], [115.02685,32.78727], [109.20410,32.78727], [109.20410,30.08810] ] ], [ [ [112.98339,26.82407], [116.69677,26.82407], [116.69677,29.03696], [112.98339,29.03696], [112.98339,26.82407] ] ] ]
GeometryCollection 是多种基本地理要素的集合,就是里面可以包含点、线、面要素
{ "type": "GeometryCollection", "geometries": [ { "type": "Point", "coordinates": [108.62, 31.02819] }, { "type": "LineString", "coordinates": [
[108.89648,30.10711], [108.218437,30.91717], [109.518437,31.217578]
] }
] }
GeometryCollection不需要放在FeatureCollection里
geojson自定义生成工具:http://geojson.io/#map=4/38.89/104.70
datav的中国省市边界下载页:http://datav.aliyun.com/tools/atlas/#&lat=30.37018632615852&lng=106.68898666525287&zoom=3.5
echarts边界下载页:https://hxkj.vip/demo/echartsMap/