空间数据格式(地理数据格式):GeoJSON(FeatureCollection)与EsriJSON(FeatureSet/ArcGIS格式)

一、FeatureCollection(GeoJSON)格式介绍

https://learn.microsoft.com/en-us/javascript/api/azure-maps-control/atlas.data.featurecollection?view=azure-maps-typescript-latest

1、FeatureCollection格式

1
2
3
4
5
6
7
8
{
  type: "FeatureCollection",
  features: [{
    type: "Feature",
    geometry: geometry,
    properties: {}
  }]
}

 2、 Geometry格式

1
2
3
4
{
    type: "Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon",
    coordinates: 数组
}

3、Point数组 ,也是下文的position数组

1
2
[longitude, latitude, elevation].
position: [longitude, latitude, elevation]

4、MultiPoint数组

1
coordinates:position[]

5、LineString数组

1
coordinates:position[]

6、MultiLineString数组

1
coordinates:position[][]

7、Polygon数组

1
coordinates:Position[][]

8、MultiPolygon数组 

1
coordinates:position[][][]

二、FeatureSet,EsriJSON格式介绍

1、FeatureSet格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    "objectIdFieldName": "objectid",
    "globalIdFieldName": "globalid",
    "geometryType": "esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope",
    "spatialReference": {
        "wkid": 102100,
        "latestWkid": 3857
    },
    "fields": [{
        "name": "objectid",
        "alias": "OBJECTID",
        "type": "esriFieldTypeOID"
    }],
    "features": [{
        "geometry": {},
        "attributes": {}
    }]
}

2、Point类型的geometry

1
2
3
4
5
6
7
8
A 2D point
geometry:{
  "x": -118.15,
  "y": 33.80,
  "spatialReference": {
    "wkid": 4326
  }
}

3、MultiPoint类型的Geometry

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
A 2D multipoint
geometry:{
  "points": [
    [
      -97.06138,
      32.837
    ],
    [
      -97.06133,
      32.836
    ]
  ],
  "spatialReference": {
    "wkid": 4326
  }
}

4、Polyline类型的Geometry

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2D polylines
geometry:{
  "paths": [
    [
      [-97.06138,32.837],
      [-97.06133,32.836],
      [-97.06124,32.834],
      [-97.06127,32.832]
    ],
    [
      [-97.06326,32.759],
      [-97.06298,32.755]
    ]
  ],
  "spatialReference": {"wkid": 4326}
}

5、PolyGon类型的Geometry

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
A 2D polygon
geometry:{
  "rings": [
    [
      [-97.06138,32.837],
      [-97.06133,32.836],
      [-97.06124,32.834],
      [-97.06127,32.832],
      [-97.06138,32.837]
    ],
    [
      [-97.06326,32.759],
      [-97.06298,32.755],
      [-97.06153,32.749],
      [-97.06326,32.759]
    ]
  ],
  "spatialReference": {
    "wkid": 4326
  }
}  

三、GeoJSON和EsriJSON的异同点

1、属性信息的异同点

geojson没有关于属性元数据的描述,fields数组、displayfield字段等;相同点是都在feature内部记录,geojson的属性字段为properties,esrijson的属性字段为attruibutes

2、坐标信息的异同点

geojson的坐标信息由不同维度的数组表示,由coordinates属性表示,每个geometry用type属性来区分是什么类型的几何;esrijson的单点是用x/y属性记录,其余多点、线、面用二维和三维数组记录,区分不同类型的几何体取决于geometry对象内的属性字段,分别为points,paths,rings。esrijson没有multipolygon和multipolyline。相同点是,二者多点和面的数组维度是一致的。

 

 

 

 

posted on   guoguor  阅读(1848)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本

导航

统计

点击右上角即可分享
微信分享提示