Module com.esri.arcgisruntime
Class PolygonBarrier
java.lang.Object
com.esri.arcgisruntime.tasks.networkanalysis.PolygonBarrier
Represents a polygon barrier that can be used to constrain routes generated by
RouteTask.
Barriers serve to temporarily restrict, add impedance (cost) to, and scale impedance on parts of the transportation network.- Since:
- 100.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPolygonBarrier(Polygon polygon) Creates an instance of PolygonBarrier with the provided geometry. -
Method Summary
Modifier and TypeMethodDescriptionintGets the polygon barrier ID.Gets the shape and location of the barrier.getName()Gets the name of the barrier.doublegetScaleFactorForCost(String attributeName) Gets the scale factor for cost.getType()Gets the type of the barrier that was set.voidsetBarrierId(int barrierId) Sets the polygon barrier ID.voidSets 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 Details
-
PolygonBarrier
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 Details
-
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:
-
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:
-
getType
Gets the type of the barrier that was set.- Returns:
- the type. Returns
BarrierType.RESTRICTIONif not set. - Since:
- 100.0.0
-
setType
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
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
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
Gets the shape and location of the barrier.- Returns:
- the geometry
- Since:
- 100.0.0
-
getName
Gets the name of the barrier.- Returns:
- the name of the barrier
- Since:
- 100.3.0
-
setName
Sets the name of the barrier.- Parameters:
name- the name of the barrier- Since:
- 100.3.0
-