This document is archived and information here might be outdated. Recommended version. |
Buffers an array of geometries by each distance specified in an array of distances. The distance units can optionally be specified. Geometries buffered at a given distance can optionally be unioned together.
[Visual Basic .NET] Public Function Buffer ( _ ByVal pInSR As ISpatialReference, _ ByVal pBufferSR As ISpatialReference, _ ByVal pOutSR As ISpatialReference, _ ByVal pDistances As IDoubleArray, _ ByVal pUnit As IUnit, _ ByVal bUnion As Boolean, _ ByVal pInGeometries As IGeometryArray _ ) As IGeometryArray
[C#] public IGeometryArray Buffer ( ISpatialReference pInSR, ISpatialReference pBufferSR, ISpatialReference pOutSR, IDoubleArray pDistances, IUnit pUnit, bool bUnion, IGeometryArray pInGeometries );
[C++]
HRESULT Buffer(
ISpatialReference* pInSR,
ISpatialReference* pBufferSR,
ISpatialReference* pOutSR,
IDoubleArray* pDistances,
IUnit* pUnit,
VARIANT_BOOL bUnion,
IGeometryArray* pInGeometries
);
[C++]
Parameters pInSR
pInSR is a parameter of type ISpatialReference* pBufferSR
pBufferSR is a parameter of type ISpatialReference* pOutSR
pOutSR is a parameter of type ISpatialReference* pDistances
pDistances is a parameter of type IDoubleArray* pUnit
pUnit is a parameter of type IUnit* bUnion
bUnion is a parameter of type bool pInGeometries
pInGeometries is a parameter of type IGeometryArray*
Applies the geometric buffer operation to each geometry in pInGeometries, using each distance in the array pDistances. All geometries are assumed to be in the coordinate system pInSR, which cannot be nil. pBufferSR is the spatial reference in which the geometries are buffered. pOutSR is the spatial reference in which the buffer polygons are returned. pInSR must be specified. Either or both of the other SRs can be null. If the output spatial reference is null, then the input spatial reference is used for output; if the buffering spatial reference is null, then the output spatial reference is used for buffering; if both output and buffer spatial references are null, then the input spatial reference is used.
The distances can be specified in a separate unit of measure. For example, the buffer distances could be specified in feet and the coordinates of the geometries could be specified in meters. If bUnion is false, each buffered polygon will be added to ppOutBuffers separately. If bUnion is true, then all geometries buffered at a given distance will be unioned into a single (possibly multipart) polygon and that unioned geometry will be placed in the output array.
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.
Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.
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).
When buffering points or multipoints and the input spatial reference is a geographic coordinate system (WGS1984, for example), you have the option of generating true geodesic buffers. To obtain such buffers, specify a linear unit of distance for the pUnit parameter.
Here is an example showing how to create a buffer using the Geometry Server.