Buffer Geometries (Geometry)

2252
4
12-08-2011 06:54 AM
RobertHeitzman
New Contributor
I'm using the REST HTML forms to create queries. Many services accept Geometries. The docs state the "geometry" returned from other REST queries is the format to use however I cannot find any JSON string that works. I'm just copying the element from a json return e.g.
{"rings":[[[5773777.49661869,2289563.95264293],[5773653.87350635,2289764.94666351],[5774526.1384941,2290309.87142669],[5774648.57525711,2290113.75075594],[5773777.49661869,2289563.95264293]]]}

I used the WKID from the metadata for the layer in all spatial refernce fields (2229) and 1000 as the distance.

I get an error Unspecified property: 'geometryType' 

What's wrong?

Could someone post a working buffer query using a polygon as the input geometry?

thanks!
0 Kudos
4 Replies
WeifengHe
Esri Contributor
I think you have to put geometryType parameter as shown below.

{"geometryType" : "esriGeometryPolygon",
"geometries" : [ {"rings":[[[5773777.49661869,2289563.95264293],[5773653.87350635,2289764.94666351],[5774526.1384941,2290309.87142669],[5774648.57525711,2290113.75075594],[5773777.49661869,2289563.95264293]]]}
]
}
0 Kudos
RobertHeitzman
New Contributor
Thanks!

Docs don't state/document how to add geom type.  Nor do they document WKID needed.

ESRI needs to invest some in tech writers that know what they are doing. I recognize the problem  - they have technical writers that are writers and but not technical.
0 Kudos
WeifengHe
Esri Contributor
I'm glad it works for you.

We are working on adding more samples/code snippet for user reference.  It is an on-going process.  Thanks for your input.
0 Kudos
RobertHeitzman
New Contributor
I noticed that other REST queries accept &geometryType=

I guess it is possible that buffer accepts multiple geometry types (eg point and polygon) in the same call - that is so it should be documented along with samples that work. If it only accepts one type the &geometryType= should probably be supported as it is in many other calls.

I think the doc currently states the the geometry required is the same as that returned via JSON. This is not the case when looking at the returns from a simple query. If there are specific services that return the patterns required it would be useful to document those so we can quickly learn what the the required pattern looks like.
0 Kudos