Your users may wish to perform additional geospatial functionality that goes beyond simple map display and interaction, such as querying information on the map, finding and display reports of real world objects, or performing an array of analyses on a map. You can achieve this by adding one or more of the following tasks to your ArcGIS Runtime application. To help you choose the task appropriate for your needs here is a brief summary of each task:
Retrieve features from a local or online map service that satisfy either an attribute and/or spatial query using the Query task. The Query task works with map services and feature services, feature layers and standalone tables; not raster layers. The Query task allows you to specify which attributes and/or geometries are returned. For more information please refer to Querying the map.
The Find task allows you to search one or more layers in a map for features with attribute values that match or contain an input value. The Find task works with map services, feature layers and raster layers; it does not work with feature services or standalone tables. The Find task allows you to specify whether a geometry is returned, though not which attributes are returned. For more information please refer to Finding text in the map.
Return features from a local or online map service at a specific location on a Map. This search can be performed using a specific geometry with a given tolerance on any number of layers in the map service. You could develop a tool to allow you to click on features of a map and then display the attributes and any related attributes of those features. For more information please refer to Identifying features on the map.
You can perform complex GIS analysis by executing geoprocessing models that have been published online as geoprocessing services or packaged into a geoprocessing package and accessed locally. For more information please start with What is geoprocessing?.
You can either find the geographic location of an address (geocode) or the address of a geographic location (reverse geocode) using the Locator Task. This operation can be performed using either online geoprocessing services or local geoprocessing packages. For more information please refer to the Geocoding and Reverse geocoding topics.
The Routing Task solve routes and provides directions between a defined set of stops while taking into account parameters such as barriers, stop order optimization, time windows, U-turn restrictions, and impedance. This task currently operates with online services only. For more information please refer to the topic Routing.
Closest Facility Task
The Closest Facility Task finds a route, directions and travel cost (e.g. time/distance) from a defined set of incidents to a defined set of facilities while taking into account parameters such as barriers, time of day, U-turn restrictions, and impedance. For instance, you can set up a closest facility problem to search for hospitals within a 15-minute drive of the site of an accident. This task currently operates with online services only. For more information please refer to Finding the closest facility to a location.
Service Area Task
The Service Area Task finds the area that can be accessed or serviced from a defined set of locations while taking into account parameters such as barriers, time windows, U-turn restrictions, and impedance. For instance, the 5-minute service area for a point on a network includes all the streets that can be reached within five minutes from that point. This task currently operates with online services. For more information please refer to Obtaining service areas for facilities.
Working with Tasks
These task classes are specifically designed to help you to extract information from ArcGIS Server services and local packages. Any of these task can be executed either synchronously or asynchronously if you wish your application to remain responsive during its execution. Your choice of execution will depend on the speed and complexity of the task that is being executed and what level of responsiveness you require for your application. For example, a Geoprocessing Task analysing a large dataset will take much longer than a simple Identify Task analysing one layer in a map service.
While the functionality of the each task varies, all tasks follow the same basic principles and patterns. To allow users of your application to interact with a task, each task follows the same steps:
- Provide an interface for specifying the task's input and displaying the task's results.
- Instantiate the task class and pass the URL of the service or layer that the task will use to the task's constructor.
- Specify the input parameters to the task.
- Execute the task synchronously or asynchronously.
- Listen for the completion of the task and present the results.