Error from BufferParameters when running point buffer operation on GeometryService

2577
0
04-11-2014 01:36 PM
TomFlahive
New Contributor III
I just upgraded to the ArcGIS Silverlight API 3.2 (from Silverlight 4 to Silverlight 5, and from VS2010 to VS 2013).  I have a custom Silverlight application that I also upgraded, and it is now working with the upgraded API, except for one error I am getting.  I have isolated the error down to a block of code.

In the application, the user can click on the map and run a buffer to see what is in the immediate area.  This involves using a buffer operation of a geometry service.  The code causing the error results from where I set up the BufferParameters:

BufferParameters bufferParameters = new BufferParameters()
{
 BufferSpatialReference = new SpatialReference(4326),
 OutSpatialReference = MyMap.SpatialReference,
 Unit = LinearUnit.SurveyFoot
};
bufferParameters.Distances.Add(feetToBuffer);
bufferParameters.Features.Add(_X_graphic);


Previously, this code ran without any errors.  But after upgrading to the latest ArcGIS Silverlight API (3.2), this now generates the following error:

"Error code '400': 'Unable to complete operation.' Wrong unit type (expected linear unit, got angular unit, or visa versa)"

When I comment out the Unit parameter line, the operation will then run, but the buffer is not the right size.  I also noticed that if I change the BufferSpatialReference from 4326 (GCS_WGS_1984) to something else,  like 102100 (Web Mercator Auxiliary Sphere), the buffer works, but it is also not the right size.

Any insights into why this code no longer works and what to do to fix it would be appreciated.

Tom
0 Kudos
0 Replies