Geometry Service Buffer method

Buffers an array of geometries by each distance specified in an array of distances.  Geometries buffered at a given distance can optionally be unioned together.

 

Buffer(SpatialReference InSpatialReference,  SpatialReference BufferSpatialReference, SpatialReference OutSpatialReference, double[] Distances, Unit Unit, boolean UnionResults, Geometry[] InGeometryArray)

 

Parameter

Description

InSpatialReference

SpatialReference of the geometries in the InGeometryArray. Cannot be null.
 

BufferSpatialReference

The SpatialReference in which the geometries are buffered.  Can be null.
 

OutSpatialReference

SpatialReference of the geometry returned from the buffer operation.  Can be null.
 

Distances

An array of double values.  Each value specifies a distance to buffer the input geometries.  
 

Unit

The units for each distance specified in the Distances array.  
 

UnionResults

If false, each buffer polygon will be added to the output Geometry array separately.   If true, then all geometries buffered at a given distance will be unioned into a single (possibly multi-part) polygon and included in the output Geometry array.
 

InGeometryArray

The array of Geometry to be buffered by each distance in the array Distances. All geometries are assumed to be in the coordinate system InSpatialReference.

 

 

Return Value

 

An array of Geometry (Geometry[]) of type Polygon.  

 

Remarks

 
Either or both the BufferSpatialReference and OutSpatialReference can be null.  If one is not null, the one defined is used for both buffering and output.   If the spatial reference is the same, the distances can still be specified in a separate unit of measure - defined by the Unit parameter to the method.   For example, the buffer distances can be specified in feet and the coordinates of the output geometries can be specified in meters, although both the buffer and output geometry share the same spatial reference.  

The SpatialReference property for all returned geometry will be null.  It is the consumers responsibility to assign the spatial reference to each geometry returned, if desired.  In this case, the spatial reference is assumed to be the output spatial reference defined for the Buffer operation.

True ground distance buffering (i.e. "geodesic" buffering) in a geographic coordinate system is only supported for point and multipoint features.  In order to meaningfully buffer polylines and polygons defined in a geographic coordinate system, you need to specify a planar (projected) coordinate system in which the buffering will happen.  Use the BufferSpatialReference parameter to define this coordinate system.  When the Buffer method is called, the input features will be projected into this coordinate system (BufferSpatialReference), buffered, and then either inverse projected into the original coordinate system (InSpatialReference) or projected into the output coordinate system (OutSpatialReference).

Examples

C#

VB.NET

Java