Generate multiple individual buffers or a single unioned buffer around multiple points.
Use case
Creating buffers is a core concept in GIS proximity analysis that allows you to visualize and locate geographic features contained within a set distance of a feature. For example, consider an area where wind turbines are proposed. It has been determined that each turbine should be located at least 2 km away from residential premises due to noise pollution regulations, and a proximity analysis is therefore required. The first step would be to generate 2 km buffer polygons around all proposed turbines. As the buffer polygons may overlap for each turbine, unioning the result would produce a single graphic result with a neater visual output. If any premises are located within 2 km of a turbine, that turbine would be in breach of planning regulations.
How to use the sample
Click/tap on the map to add points. Click the "Create Buffer(s)" button to draw buffer(s) around the points (the size of the buffer is determined by the value entered by the user). Check the check box if you want the result to union (combine) the buffers. Click the "Clear" button to start over. The red dashed envelope shows the area where you can expect reasonable results for planar buffer operations with the North Central Texas State Plane spatial reference.
How it works
- Use
GeometryEngine.Buffer(points, distances, union)
to create aPolygon
. The parameterpoints
are the points to buffer around,distances
are the buffer distances for each point (in meters) andunion
is a boolean for whether the results should be unioned. - Add the resulting polygons (if not unioned) or single polygon (if unioned) to the map's
GraphicsOverlay
as aGraphic
.
Relevant API
- Geometry
- GeometryEngine.Buffer
- SpatialReference
Additional information
The properties of the underlying projection determine the accuracy of buffer polygons in a given area. Planar buffers work well when analyzing distances around features that are concentrated in a relatively small area in a projected coordinate system. Inaccurate buffers could still be created by buffering points inside the spatial reference's envelope with distances that move it outside the envelope. On the other hand, geodesic buffers consider the curved shape of the Earth's surface and provide more accurate buffer offsets for features that are more dispersed (i.e., cover multiple UTM zones, large regions, or even the whole globe). See the "Buffer" sample for an example of a geodesic buffer.
For more information about using buffer analysis, see the topic How Buffer (Analysis) works in the ArcGIS Pro documentation.
Tags
analysis, buffer, geometry, planar
Sample Code
<UserControl
x:Class="ArcGIS.UWP.Samples.BufferList.BufferList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
<Grid>
<esriUI:MapView x:Name="MyMapView" />
<Border Style="{StaticResource BorderStyle}">
<StackPanel>
<TextBlock
x:Name="BufferInstructionsLabel"
Margin="0,0,0,10"
TextWrapping="Wrap">
Tap on the map to add points. Each point will use the buffer distance entered when it was created. The envelope shows the area where you can expect reasonable results for planar buffer operations with the North Central Texas State Plane spatial reference.
</TextBlock>
<StackPanel Orientation="Horizontal">
<TextBlock
Margin="0,0,5,0"
VerticalAlignment="Center"
FontWeight="SemiBold"
Text="Distance (miles):" />
<TextBox
x:Name="BufferDistanceMilesTextBox"
VerticalAlignment="Center"
Text="10" />
<CheckBox
x:Name="UnionCheckBox"
Margin="10,0,0,0"
VerticalAlignment="Center"
Content="Union the buffer(s)"
FontWeight="SemiBold"
IsChecked="True" />
</StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<Button
x:Name="BufferButton"
Width="174"
Click="BufferButton_Click"
Content="Create buffer(s)" />
<Button
x:Name="ClearButton"
Width="174"
Margin="10,0,0,0"
Click="ClearButton_Click"
Content="Clear" />
</StackPanel>
</StackPanel>
</Border>
</Grid>
</UserControl>