Class PolygonBarrier
- java.lang.Object
 - 
- com.esri.arcgisruntime.tasks.networkanalysis.PolygonBarrier
 
 
- 
public final class PolygonBarrier extends Object
Represents a polygon barrier that can be used to constrain routes generated byRouteTask. Barriers serve to temporarily restrict, add impedance (cost) to, and scale impedance on parts of the transportation network.- Since:
 - 100.0.0
 - See Also:
 - http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm
 
 
- 
- 
Constructor Summary
Constructors Constructor Description PolygonBarrier(Polygon polygon)Creates an instance of PolygonBarrier with the provided geometry. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBarrierId()Gets the polygon barrier ID.PolygongetGeometry()Gets the shape and location of the barrier.StringgetName()Gets the name of the barrier.doublegetScaleFactorForCost(String attributeName)Gets the scale factor for cost.BarrierTypegetType()Gets the type of the barrier that was set.voidsetBarrierId(int barrierId)Sets the polygon barrier ID.voidsetName(String name)Sets the name of the barrier.voidsetScaleFactorForCost(String attributeName, double addedCost)Sets the scale factor for cost for the barrier.voidsetType(BarrierType type)Sets the type of the barrier, whether it fully restricts travel across it, or merely increases the cost of travel. 
 - 
 
- 
- 
Constructor Detail
- 
PolygonBarrier
public PolygonBarrier(Polygon polygon)
Creates an instance of PolygonBarrier with the provided geometry.- Parameters:
 polygon- defining the shape and location of the barrier- Throws:
 IllegalArgumentException- if polygon is null- Since:
 - 100.0.0
 
 
 - 
 
- 
Method Detail
- 
getBarrierId
public int getBarrierId()
Gets the polygon barrier ID.This is a caller supplied foreign key that can be used to associate output polygon barriers with input polygon barriers.
- Returns:
 - the polygon barrier ID
 - Since:
 - 100.6.0
 - See Also:
 ClosestFacilityParameters.setPolygonBarriers(Iterable),ClosestFacilityParameters.setPolygonBarriers(ArcGISFeatureTable, QueryParameters),ClosestFacilityResult.getPolygonBarriers(),RouteParameters.setPolygonBarriers(Iterable),RouteParameters.setPolygonBarriers(ArcGISFeatureTable, QueryParameters),RouteResult.getPolygonBarriers(),ServiceAreaParameters.setPolygonBarriers(Iterable),ServiceAreaParameters.setPolygonBarriers(ArcGISFeatureTable, QueryParameters),ServiceAreaResult.getPolygonBarriers()
 
- 
setBarrierId
public void setBarrierId(int barrierId)
Sets the polygon barrier ID.This is a caller supplied foreign key that can be used to associate output polygon barriers with input polygon barriers.
- Parameters:
 barrierId- the polygon barrier ID- Since:
 - 100.6.0
 - See Also:
 ClosestFacilityParameters.setPolygonBarriers(Iterable),ClosestFacilityParameters.setPolygonBarriers(ArcGISFeatureTable, QueryParameters),ClosestFacilityResult.getPolygonBarriers(),RouteParameters.setPolygonBarriers(Iterable),RouteParameters.setPolygonBarriers(ArcGISFeatureTable, QueryParameters),RouteResult.getPolygonBarriers(),ServiceAreaParameters.setPolygonBarriers(Iterable),ServiceAreaParameters.setPolygonBarriers(ArcGISFeatureTable, QueryParameters),ServiceAreaResult.getPolygonBarriers()
 
- 
getType
public BarrierType getType()
Gets the type of the barrier that was set.- Returns:
 - the type. Returns 
BarrierType.RESTRICTIONif not set. - Since:
 - 100.0.0
 
 
- 
setType
public void setType(BarrierType type)
Sets the type of the barrier, whether it fully restricts travel across it, or merely increases the cost of travel.- Parameters:
 type- type- Since:
 - 100.0.0
 
 
- 
getScaleFactorForCost
public double getScaleFactorForCost(String attributeName)
Gets the scale factor for cost.- Parameters:
 attributeName- attribute name. It can be empty. Null is treated as an empty string.- Returns:
 - the scale factor for cost. Returns 1 if it was not set.
 - Since:
 - 100.0.0
 
 
- 
setScaleFactorForCost
public void setScaleFactorForCost(String attributeName, double addedCost)
Sets the scale factor for cost for the barrier.- Parameters:
 attributeName- attribute name. It can be empty. Null is treated as an empty string.addedCost- added cost- Since:
 - 100.0.0
 
 
- 
getGeometry
public Polygon getGeometry()
Gets the shape and location of the barrier.- Returns:
 - the geometry
 - Since:
 - 100.0.0
 
 
- 
getName
public String getName()
Gets the name of the barrier.- Returns:
 - the name of the barrier
 - Since:
 - 100.3.0
 
 
- 
setName
public void setName(String name)
Sets the name of the barrier.- Parameters:
 name- the name of the barrier- Since:
 - 100.3.0
 
 
 - 
 
 -