Durga Durga - 9 months ago 34
Android Question

How to Get Buffer for Road in Arcgis Android?

I am developing one Application using

. Here i want to implement buffer for both point and line Segments (road).

Here i successfully get buffer for point using this method

GeometryEngine.buffer(geometry1,mMapView.getSpatialReference(), meters, null)

where as for road if it is single Segment i am able draw buffer.I am unable to draw buffer for multiple Segments.

Please give me solution for this.I want like

my code
enter image description here

polygon = GeometryEngine.buffer(geometry1,
mMapView.getSpatialReference(), meters, null);
withingeometry = GeometryEngine.project(polygon,

SimpleFillSymbol sls = new SimpleFillSymbol(Color.TRANSPARENT);

Graphic graphics= new Graphic(withingeometry,sls);


There are two options that should produce the result you want, both involving the GeometryEngine.union(Geometry[], SpatialReference) method:

  1. Call union on an array of the Geometry objects you want to buffer to produce a single Geometry, and then call buffer on that single Geometry.
  2. Call buffer on an array of the Geometry objects you want to buffer to produce a Polygon array, and then call union on that Polygon array.