Select to view content in your preferred language

polyline and polygon buffer issues using geometry service

956
2
08-09-2011 07:25 AM
NimeshMorkar
New Contributor
I am creating buffer on point, polyline and polygon features, polyline and polygon buffer was not working as expected.

I am using geometry service to create buffer around the line and polygon using the following buffer parameter.

var bufferParameters:BufferParameters = new BufferParameters();
bufferParameters.geometries = [geometry]; // geometry spatialReference is 102100
bufferParameters.distances = [1000];
bufferParameters.unit = GeometryService.UNIT_METER;
bufferParameters.bufferSpatialReference = new SpatialReference(102100);
bufferParameters.outSpatialReference =  map.spatialReference; // map spatialReference is 102100

I have added returned geometry to map using graphic layer and when I measured using annotation tool it was around 730 meter seems buffered geometry was not correct.

Could anyone tell me what I am doing wrong or something I am missing?
Did anyone have these issues?
Tags (2)
0 Kudos
2 Replies
JasonLevine
Deactivated User
This is most likely a projection issue.  If you're using web mercator, your measurements will be off.  Read through this article: http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2010/03/05/Measuring-distances-and-areas-when-y....  You need to reproject to a more appropriate coordinate system (depending on your location) and then do the buffer.

Hope this helps.
0 Kudos
NimeshMorkar
New Contributor
Thanks for the reply, we fixed the issue...We changed bufferSpatialReference to WKID - 26918

bufferParameters.bufferSpatialReference = new SpatialReference(26918);
bufferParameters.distances = [1]; //
bufferParameters.unit = GeometryService.UNIT_STATUTE_MILE // this can be mile or feet
0 Kudos