# Method Buffer

#### Buffer(Geometry, Double)

Creates a buffer polygon at the specified distance around the given geometry. This is a planar buffer operation. Use BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType) to produce geodetic buffers.

##### Declaration

`public static Geometry Buffer(this Geometry geometry, double distance)`

##### Parameters

Type | Name | Description |
---|---|---|

Geometry | geometry | Specifies the input geometry. |

Double | distance | The distance in the unit of the geometry's spatial reference for which to buffer the geometry. |

##### Returns

Type | Description |
---|---|

Geometry | The Polygon that represents the buffered area. |

##### Remarks

Planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the geometry's spatial reference. If you need to calculate more accurate results consider using a different spatial reference, or using the geodetic equivalent, BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType). See Spatial References for more information about spatial references.

Supports true curves as input, producing a densified curve as output where applicable.

The polygon geometry that is generated from this Static Method is based upon the SpatialReference of the input geometry. A SpatialReference is a combination of an ellipsoid, datum, and a coordinate system used to display (aka. project) geographic data of the three dimensional Earth on a two dimensional surface (such as a piece of paper of computer monitor). A good article for describing how a spatial reference works can be found here. The important thing to know about creating buffers is that some SpatialReferences are better than others for getting accurate results. To get the most accurate buffer polygons using this method, consider using an 'area preserving' SpatialReference such as: Albers, Lambert, Mollweide, Hammer, Sinusoidal, and the like. If the input geometry to this method is not based on a good 'area preserving' SpatialReference, then there are two options available to produce accurate buffers: (1) use the Project(Geometry, SpatialReference) Static Method to project the geometry to a coordinate system that is better suited for buffers or (2) use the BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType) Static Method which will use an internal projection algorithm to convert the geometry to a spherical coordinate system to obtain the most accurate buffers possible. See the Make measurements topic in the developers guide for more information.

### Applies to

## Platforms and versions

Target | Versions |
---|---|

.NET Standard 2.0 | 100.3 - 200.1 |

.NET 6.0 | 100.13 - 200.1 |

.NET 6.0 Windows | 100.13 - 200.1 |

.NET 6.0 Android | 200.0 - 200.1 |

.NET 6.0 iOS | 200.0 - 200.1 |

.NET Framework | 100.0 - 200.1 |

.NET 5 | 100.10 - 100.12 |

.NET Core 3.1 | 100.7 - 100.12 |

Android | 100.0 - 100.15 |

iOS | 100.0 - 100.15 |

UWP | 100.0 - 200.1 |

##### Relevant samples

#### Buffer(IEnumerable<Geometry>, IEnumerable<Double>, Boolean)

Creates and returns a buffer relative to the given geometries. This is a planar buffer operation. Use BufferGeodetic(Geometry, Double, LinearUnit, Double, GeodeticCurveType) to produce geodetic buffers.

##### Declaration

`public static IEnumerable<Geometry> Buffer(IEnumerable<Geometry> geometries, IEnumerable<double> distances, bool unionResult)`

##### Parameters

Type | Name | Description |
---|---|---|

IEnumerable<Geometry> | geometries | A collection of geometries. |

IEnumerable<Double> | distances | The distance to buffer each geometry, expressed as a sequence of double. If the size of the distances collection is less than the number of geometries, the last distance value is used for the rest of geometries. |

Boolean | unionResult | Returns a single geometry that buffers all the geometries (true), or one buffer for each in the given collection (false). |

##### Returns

Type | Description |
---|---|

IEnumerable<Geometry> | A collection of polygon geometries that represent a buffer at the desired distance(s) around the given geometries.
If |

##### Remarks

The geometries must have the same spatial reference. Planar measurements of distance and area can be extremely
inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the
geometry's spatial reference. If you need to calculate
more accurate results consider using a different spatial reference, or using the geodetic equivalent,
BufferGeodetic(IEnumerable<Geometry>, IEnumerable<Double>, LinearUnit, Double, GeodeticCurveType, Boolean).
See the document
Spatial References
for more information about spatial references. If `unionResult`

is `true`

, the
output collection will contain a single result. If geometries is empty, an empty array is returned.

Supports true curves as input, producing a densified curve as output where applicable.

This method allows for the creation of different buffered output geometry sizes for each input in the **geometries** collection
based upon the values in the **distances** collection. Under most circumstances, there would be a one-to-one correspondence of
input **geometries** to the input buffer **distances**. However, it is possible to have fewer input buffer **distances**
than input **geometries**. In this case, the last distance value in the buffer **distances** collection will be used for the
rest of the **geometries**. In an extreme case, one could specify a single buffer value in the input buffer **distances**
collection and that value would apply to all of the input **geometries** collection.

The polygons generated from this Static Method are based upon the SpatialReference of the input geometries. A SpatialReference is a combination of an ellipsoid, datum, and a coordinate system used to display (aka. project) geographic data of the three dimensional Earth on a two dimensional surface (such as a piece of paper or computer monitor). A good article for describing how a spatial reference works can be found here. The important thing to know about creating buffers is that some SpatialReferences are better than others for getting accurate results. To get the most accurate buffer polygons using this method, consider using an 'area preserving' SpatialReference such as: Albers, Lambert, Mollweide, Hammer, Sinusoidal, and the like. If the input geometries to this method are not based on a good 'area preserving' SpatialReference, then there are two options available to produce accurate buffers: (1) use the Project(Geometry, SpatialReference) Static Method to project the geometry to a coordinate system that is better suited for buffers or (2) use the BufferGeodetic(IEnumerable<Geometry>, IEnumerable<Double>, LinearUnit, Double, GeodeticCurveType, Boolean) Static Method which will use an internal projection algorithm to convert the geometry to a spherical coordinate system to obtain the most accurate buffers possible. /// See the Make measurements topic in the developers guide for more information.

### Applies to

## Platforms and versions

Target | Versions |
---|---|

.NET Standard 2.0 | 100.3 - 200.1 |

.NET 6.0 | 100.13 - 200.1 |

.NET 6.0 Windows | 100.13 - 200.1 |

.NET 6.0 iOS | 200.0 - 200.1 |

.NET Framework | 100.1 - 200.1 |

.NET 5 | 100.10 - 100.12 |

.NET Core 3.1 | 100.7 - 100.12 |

Android | 100.1 - 100.14 |

iOS | 100.1 - 100.15 |

UWP | 100.1 - 200.1 |