Class PolylineBarrier
- java.lang.Object
-
- com.esri.arcgisruntime.tasks.networkanalysis.PolylineBarrier
-
public final class PolylineBarrier extends java.lang.Object
Represents a polyline 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 PolylineBarrier(Polyline polyline)
Creates an instance of PolylineBarrier with provided geometry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBarrierId()
Gets the polyline barrier ID.Polyline
getGeometry()
Gets the shape and location of the barrier.java.lang.String
getName()
Gets the name of the barrier.double
getScaleFactorForCost(java.lang.String attributeName)
Gets the scale factor for cost.BarrierType
getType()
Gets the type that was set.void
setBarrierId(int barrierId)
Sets the polyline barrier ID.void
setName(java.lang.String name)
Sets the name of the barrier.void
setScaleFactorForCost(java.lang.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 Detail
-
PolylineBarrier
public PolylineBarrier(Polyline polyline)
Creates an instance of PolylineBarrier with provided geometry.- Parameters:
polyline
- defining the shape and location of the barrier- Throws:
java.lang.IllegalArgumentException
- if polyline is null- Since:
- 100.0.0
-
-
Method Detail
-
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:
ClosestFacilityParameters.setPolylineBarriers(Iterable)
,ClosestFacilityParameters.setPolylineBarriers(ArcGISFeatureTable, QueryParameters)
,ClosestFacilityResult.getPolylineBarriers()
,RouteParameters.setPolylineBarriers(Iterable)
,RouteParameters.setPolylineBarriers(ArcGISFeatureTable, QueryParameters)
,RouteResult.getPolylineBarriers()
,ServiceAreaParameters.setPolylineBarriers(Iterable)
,ServiceAreaParameters.setPolylineBarriers(ArcGISFeatureTable, QueryParameters)
,ServiceAreaResult.getPolylineBarriers()
-
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:
ClosestFacilityParameters.setPolylineBarriers(Iterable)
,ClosestFacilityParameters.setPolylineBarriers(ArcGISFeatureTable, QueryParameters)
,ClosestFacilityResult.getPolylineBarriers()
,RouteParameters.setPolylineBarriers(Iterable)
,RouteParameters.setPolylineBarriers(ArcGISFeatureTable, QueryParameters)
,RouteResult.getPolylineBarriers()
,ServiceAreaParameters.setPolylineBarriers(Iterable)
,ServiceAreaParameters.setPolylineBarriers(ArcGISFeatureTable, QueryParameters)
,ServiceAreaResult.getPolylineBarriers()
-
getType
public BarrierType getType()
Gets the type that was set.- Returns:
- the type. Returns
BarrierType.RESTRICTION
if 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(java.lang.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(java.lang.String attributeName, double addedCost)
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
public Polyline getGeometry()
Gets the shape and location of the barrier.- Returns:
- the geometry
- Since:
- 100.0.0
-
getName
public java.lang.String getName()
Gets the name of the barrier.- Returns:
- the name of the barrier
- Since:
- 100.3.0
-
setName
public void setName(java.lang.String name)
Sets the name of the barrier.- Parameters:
name
- the name of the barrier- Since:
- 100.3.0
-
-