Geometry Service Buffer method

Buffers an array of geometries by each distance specified in an array of distances. The distances can be specified in any linear unit of measure. 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

The spatial reference of the geometries in the InGeometryArray parameter. This cannot be null. 

BufferSpatialReference

The spatial reference in which the geometries are buffered.  This can be null. 

OutSpatialReference

The spatial reference of the geometry returned from the buffer operation.  This 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 referenced in the InSpatialReference parameter.

 

Return Value

 

Returns 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 other is used for both buffering and output.   In any case, the distances can be specified with 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.

 

Buffering of geometries with latitude-longitude coordinates is only supported for points and multipoints.  In order to meaningfully buffer polylines and polygons with such coordinates, 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). 

 

In order to minimize the errors it is recommended the use chooses a projection appropriate to the geometries for buffering.  For a geometry or set of geometries that are in a circular pattern an azimuthal equidistant projection with a point of tangency at the center of the geometry(s) is recommended.  If the geometry or set of geometries have a linear arrangement, then it might be possible to use a Hotine (oblique Mercator) projection, whose line of tangency falls along the linear trend of the geometry or geometries in question.  

 

Examples

C#

VB.NET

Java