一、FeatureCollection(GeoJSON)格式介绍
1、FeatureCollection格式
{
type:"FeatureCollection",
features: [
{
type:"Feature",
geometry:geometry,
properties:{}
}
]
}
2、 Geometry格式
{ type:"Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon", coordinates:数组 }
3、Point数组 ,也是下文的position数组
[longitude,latitude,elevation].
position: [longitude,latitude,elevation]
4、MultiPoint数组
coordinates:position[]
5、LineString数组
coordinates:position[]
6、MultiLineString数组
coordinates:position[][]
7、Polygon数组
coordinates:Position[][]
8、MultiPolygon数组
coordinates:position[][][]
二、FeatureSet,EsriJSON格式介绍
1、FeatureSet格式
{ "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
A 2D point geometry:{ "x": -118.15, "y": 33.80, "spatialReference": { "wkid": 4326 } }
3、MultiPoint类型的Geometry
A 2D multipoint geometry:{ "points": [ [ -97.06138, 32.837 ], [ -97.06133, 32.836 ] ], "spatialReference": { "wkid": 4326 } }
4、Polyline类型的Geometry
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
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。相同点是,二者多点和面的数组维度是一致的。
标签:geometry,wkid,coordinates,ArcGIS,GeoJSON,数组,position,数据格式,属性 From: https://www.cnblogs.com/guoguocode/p/16982254.html