Select to view content in your preferred language

Buffer Display Problem for different input

2112
4
Jump to solution
05-24-2012 02:15 AM
by Anonymous User
Not applicable
Original User: e_saurabh

Hi
  I am performing a buffer functionality to get the results for the buffer drawn around the features. I am following Point,Polyline, Polygon and Envelope feature to draw the buffer results.

When I select the Point feature to draw the buffer it accepts the input distance of 1 - 10 meters and draws the buffer graphics correctly and show on the map. But When I provide the same input distance for Polyline, Polygon and Envelope, it covers the whole of map and draws the buffer graphics for it. As a result I need to provide some smaller distance of say around 0.000005 meters to get the buffer results correctly. Can anybody provide me the solution for this as I need to provide the same disance parameters for all the feaures and need to get the buffer results correctly.

Please find the below code

                        _geometryService.BufferCompleted += GeometryService_BufferCompleted;
                        _geometryService.Failed += GeometryService_Failed;
                        _geometryService.CancelAsync();

                        BufferParameters buffParameters = new BufferParameters();
                        buffParameters.Unit = LinearUnit.Meter;
                        buffParameters.BufferSpatialReference = new SpatialReference(4283);
                        buffParameters.OutSpatialReference = edmsMap.SpatialReference;
                        buffParameters.UnionResults = true;

                        GraphicsLayer graphicsLayerAddress = edmsMap.Layers["selectionGraphicsLayer"] as GraphicsLayer;

                        Graphic graphic = new Graphic()
                        {
                            Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.FillSymbol,
                            Geometry = e.Geometry

                        };
                        buffParameters.Distances.Add(bufferDistance);
                        buffParameters.Features.Add(graphic);

                        _geometryService.BufferAsync(buffParameters);





                     GraphicsLayer graphicsLayer = edmsMap.Layers["selectionGraphicsLayer"] as GraphicsLayer;
                if (e.Results != null)
                {
                    foreach (Graphic graphic in e.Results)
                    {
                        graphic.Symbol = LayoutRoot.Resources["BufferSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
                        graphicsLayer.Graphics.Add(graphic);
                    }
                }

Attached are the screenshots for the buffer results drawn for Point,Polyline and Polygon.

~Saurabh.
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
I already noticed this strange behavior without explaining it (see this thread).

I suggest you try by setting the BufferSpatialReference to 102100, and, if needed, take care of the mercator distorsion as indicated in the referenced thread.

View solution in original post

0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
I already noticed this strange behavior without explaining it (see this thread).

I suggest you try by setting the BufferSpatialReference to 102100, and, if needed, take care of the mercator distorsion as indicated in the referenced thread.
0 Kudos
by Anonymous User
Not applicable
Original User: e_saurabh

Hi Dominique,
                  Thanks a lot for the reply. The changing of  BufferSpatialReference to 102100 did the trick and the behaviour is consistent for Point,Polyline and Polygon now. No more decimals is required.

But just a query, all my map graphics and the BaseMap layer has been set to the spatial reference of 4283. Will this change of 102100 is going to affect my application in future anyway? We are palnning for GoLive for our application!!

~Saurabh.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
But just a query, all my map graphics and the BaseMap layer has been set to the spatial reference of 4283. Will this change of 102100 is going to affect my application in future anyway?

You should not have any problem.
BufferSpatialReference affects only the way the buffer is calculated at the server side.
So the only impact of this change might be a distorsion in the buffer size (for example Web Mercator distorsion as mentionned in the another thread).
0 Kudos
by Anonymous User
Not applicable
Original User: e_saurabh

Hi Dominique,
                    Thanks once again. Will check the distorsion if any..

~Saurabh.
0 Kudos