Determine spatial relationships between two geometries.
In case of a natural disaster, emergency services can represent the affected areas using polygons. By determining the spatial relationships between these and any other existing features such as populated areas, infrastructure, or natural resources, it is possible to quickly determine which of the existing features might be affected or is in further danger, helping to assess risk and define further action.
Select one of the three graphics. The tree view will list the relationships the selected graphic has to the other graphic geometries.
- Get the geometry from two different graphics. In this example the geometry of the selected graphic is compared to the geometry of each unselected graphic.
- Use the methods in
GeometryEngineto check the relationship between the geometries, e.g.
intersects, etc. If the method returns
true, the relationship exists.
geometries, relationship, spatial analysis
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms" xmlns:local="clr-namespace:ArcGISRuntime.Samples.ListTransformations" x:Class="ArcGISRuntime.Samples.SpatialRelationships.SpatialRelationships"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="2*" /> </Grid.RowDefinitions> <Label Grid.Row="0" x:Name="ResultTextbox" /> <esriUI:MapView x:Name="MyMapView" Grid.Row="1" /> </Grid> </ContentPage>