Module com.esri.arcgisruntime
Class PolylineBarrier
java.lang.Object
com.esri.arcgisruntime.tasks.networkanalysis.PolylineBarrier
Represents a polyline 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
ConstructorDescriptionPolylineBarrier
(Polyline polyline) Creates an instance of PolylineBarrier with provided geometry. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the polyline 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 that was set.void
setBarrierId
(int barrierId) Sets the polyline barrier ID.void
Sets the name of the barrier.void
setScaleFactorForCost
(String attributeName, double addedCost) Sets the scale factor for cost.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
-
PolylineBarrier
Creates an instance of PolylineBarrier with provided geometry.- Parameters:
polyline
- defining the shape and location of the barrier- Throws:
IllegalArgumentException
- if polyline is null- Since:
- 100.0.0
-
-
Method Details
-
getBarrierId
public int getBarrierId()Gets the polyline barrier ID.This is a caller supplied foreign key that can be used to associate output polyline barriers with input polyline barriers.
- Returns:
- the polyline barrier ID
- Since:
- 100.6.0
- See Also:
-
setBarrierId
public void setBarrierId(int barrierId) Sets the polyline barrier ID.This is a caller supplied foreign key that can be used to associate output polyline barriers with input polyline barriers.
- Parameters:
barrierId
- the polyline barrier ID- Since:
- 100.6.0
- See Also:
-
getType
Gets the type 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.- 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
-