Select to view content in your preferred language

Inside Polygon Buffer and QueryTask Crossing Polygons

1891
2
02-14-2011 09:22 AM
BradBarnell
Regular Contributor
I have two questions:

1) Is there a way to use the Geometry Service with a negative buffer distance?  I am trying to create an inside buffer polygon.  Is there a workaround for this problem?

2) Is there a workaround for the QueryTask to make it crash more gracefully when its geometry property is set to a polygon with crossing linework?  For example, if a user draws a figure 8 polygon and trys to query for features based on this polygon it crashes.
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
#1 - The error you are seeing is from the service.

{"error":{"code":400,"message":"Unable to complete Buffer operation.","details":["An error occured while buffering geometry. Unable to complete the operation.","The coordinates or measures are out of bounds."]}}

You may need to call Simplify and use the simplified geometry instead.

#2 - I could not replicate the crashing when using this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SpatialQuery
I get results whether the polygon I create has hole in it or not.

For both cases, GeometryService and QueryTask, you can subscribe and handle Failed events. Also, to ensure that you are sending a valid geometry for your query, call Simplify on it first. Here's an example: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Simplify
0 Kudos
BradBarnell
Regular Contributor
Yes, the ESRI sample does work.  Not sure why mine does not.  I will log an incident.
0 Kudos