Find service areas for multiple facilities
Find the service areas of several facilities from a feature service.
A service area is a region which can be accessed from a facility as limited by one or more factors, such as travel time, distance, or cost. When analyzing the service area of multiple facilities, this workflow can be used to identify gaps in service area coverage, or significant overlaps, helping to optimize the distribution of facilities. For example, a city's health service may identify areas of a city that can be served effectively from particular hospitals, and with this optimize distribution of staff and resources.
Tap 'find service area' to calculate and display the service area of each facility on the map. The polygons displayed around each facility represents the service area; in red is the area that is within 3 minutes away from the hospital by car. Light orange is the area that is within 5 minutes away from the hospital by car.
- Create a new
ServiceAreaTaskfrom a network service.
- Create default
ServiceAreaParametersfrom the service area task.
- Set the parameters
ServiceAreaParameters.ReturnPolygons = trueto return polygons of all service areas.
- Add facilities of the
ServiceAreaParameters. For this, use a set of
QueryParametersto select features from a
- Get the
ServiceAreaResultby solving the service area task using the parameters.
- For each facility, get any
ServiceAreaPolygonsthat were returned,
- Display the service area polygons as
This sample uses a street map of San Diego, in combination with a feature service with facilities (used here to represent hospitals). Additionally a street network is used on the server for calculating the service area.
facilities, feature service, impedance, network analysis, service area, travel time
<ContentPage x:Class="ArcGISRuntimeXamarin.Samples.FindServiceAreasForMultipleFacilities.FindServiceAreasForMultipleFacilities" 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"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Button x:Name="ServiceAreaButton" Grid.Row="0" Clicked="FindServiceArea_Clicked" IsEnabled="False" Text="Find service area" /> <ActivityIndicator x:Name="ProgressView" Grid.Row="1" IsRunning="True" IsVisible="False" /> <esriUI:MapView x:Name="MyMapView" Grid.Row="2" /> </Grid> </ContentPage>