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
ConstructorDescriptionPolygonBarrier
(Polygon polygon) Creates an instance of PolygonBarrier with the provided geometry. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the polygon barrier ID.Gets the shape and location of the barrier.getName()
Gets the name of the barrier.double
getScaleFactorForCost
(String attributeName) Gets the scale factor for cost.getType()
Gets the type of the barrier that was set.void
setBarrierId
(int barrierId) Sets the polygon barrier ID.void
Sets the name of the barrier.void
setScaleFactorForCost
(String attributeName, double addedCost) Sets the scale factor for cost for the barrier.void
setType
(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.RESTRICTION
if 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
-