Class ClosestFacilityParameters

java.lang.Object
com.esri.arcgisruntime.tasks.networkanalysis.ClosestFacilityParameters

public final class ClosestFacilityParameters extends Object
Settings that are used when solving ClosestFacilityTask. This class contains all inputs for the ClosestFacilityTask, as well as settings such as he impedance attribute, accumulate and restriction attributes, backtrack (u-turn) policy, etc.

Use ClosestFacilityTask.createDefaultParametersAsync() to get an instance of this class that is initialized with smart default values based on the task's metadata ClosestFacilityTask.getClosestFacilityTaskInfo().

To set the facilities, incidents and barriers (point, polyline or polygon) for solving a closest facility, you can use the following methods setFacilities(Iterable), setIncidents(Iterable), setPointBarriers(Iterable), setPolylineBarriers(Iterable) or setPolygonBarriers(Iterable). For example:

 
 List<Facility> facilities = new ArrayList<Facility>();
 facilities.add(new Facility(new Point(-13052490.008, 4035542.739, SpatialReferences.getWebMercator())));
 mClosestFacilityParameters.setFacilities(facilities);
 
 

You can also set facilities, incidents and barriers by executing queries on a FeatureTable and extracting the facilities, incidents or barriers from features within the table, using setFacilities(ArcGISFeatureTable, QueryParameters), setIncidents(ArcGISFeatureTable, QueryParameters), setPointBarriers(ArcGISFeatureTable, QueryParameters), setPolylineBarriers(ArcGISFeatureTable, QueryParameters), and setPolygonBarriers(ArcGISFeatureTable, QueryParameters).

Since:
100.1.0