ArcGIS REST Services Directory的Geometries参数-(转)

ArcGIS REST Services Directory的Geometries参数  

2013-10-26 14:25:55|  分类: ARCGIS |  标签:geometries  |举报|字号 订阅

 
 
http://gis.jl.gov.cn/Portal/api/rest/buffer.html
geometries 描述:待执行缓冲区分析的几何图形数组。几何图形的空间参考通过inSR参数指定。数组中每个几何图形的结构与ArcGIS REST API响应返回的JSON的多边形对象(polygon objects)相同。

语法和实例

JSON结构:

语法:
{
"geometryType" : "<esriGeometryPoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryMultipoint>"
"geometries" : [ <geometry1>, <geometry2> ]
}

属性geometries是一个输入几何图形的数组。通过geometryType定义该数组中所有几何图形的类型。

示例
{
"geometryType" : "esriGeometryPoint",
"geometries" : [
{"x" : -104.53, "y" : 34.74},
{"x" : -63.53, "y" : 10.23}
]
}

针对点状几何图形的简单语法:

使用点状几何图形时,除了采用JSON结构外,更简单的方法是直接用逗号进行分隔。

语法geometries=x1, y1, x2, y2, ..., xn, yn
示例: geometries=-104.53, 34.74, -63.53, 10.23

 

URL基础:

对于非常大的几何集合,可以采用JSON格式存储的文件的URL地址作为输入几何图形的参数。

语法geometries={ "url" : "<URL to file>" }
示例geometries={ "url" : "http://myserver/mygeometries/afile.txt" }

 

Point

一个点包含xy字段以及spatialReference字段。

JSON 语法

{
"x" : <x>, "y" : <y>, "spatialReference" : {<spatialReference>}
}

JSON 示例

{
"x" : -118.15, "y" : 33.80, "spatialReference" : {"wkid" : 4326}
}

Polyline

polyline包含paths数组和spatialReference。每个路径都用一个点数组来描述。路径里的每个点都用2个元素的数组表示。0-index是x坐标,1-index是y坐标。

JSON 语法

{
"paths" : [
[ [<x11>, <y11>], [<x12>, <y12>] ],
[ [<x21>, <y21>], [<x22>, <y22>] ]
],
"spatialReference" : {<spatialReference>}
}

JSON 示例

{
"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}
}

多边形

多边形包含rings数组和spatialReference。每个rings都用点数组来表示。每个环的第一个点总是和最后一个点一致。环里面的每个点都用2个要素的数组表示。0-index是x坐标,1-index是y坐标。

JSON 语法

{
"rings" : [
[ [<x11>, <y11>], [<x12>, <y12>], ..., [<x11>, <y11>] ],
[ [<x21>, <y21>], [<x22>, <y22>], ..., [<x21>, <y21>] ]
],
"spatialReference" : {<spatialReference>}
}

JSON 示例

{
"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}
}

Multipoint

multipoint包含一个点数组和spatialReference。每个点都用2个要素的数组表示。0-index是x坐标,1-index是y坐标。

JSON 语法

{
"points" : [ [<x1>, <y1>], [<x2>, <y2>] ],
"spatialReference" : {<spatialReference>}
}

JSON 示例

{
"points" : [ [-97.06138,32.837], [-97.06133,32.836], [-97.06124,32.834], [-97.06127,32.832] ],
"spatialReference" : {"wkid" : 4326}
}

Envelope

envelope包含一个范围顶点,用xminyminxmax, 和 ymax连同spatialReference一起表示。

JSON 语法

{
"xmin" : <xmin>, "ymin" : <ymin>, "xmax" : <xmax>, "ymax" : <ymax>,
"spatialReference" : {<spatialReference>}
}

JSON 示例

{
"xmin" : -109.55, "ymin" : 25.76, "xmax" : -86.39, "ymax" : 49.94,
"spatialReference" : {"wkid" : 4326}
}
posted on 2014-04-28 10:34  办幼儿园+国家电网1亿  阅读(1021)  评论(0编辑  收藏  举报

返回顶部