Module com.esri.arcgisruntime
Class PointBarrier
java.lang.Object
com.esri.arcgisruntime.tasks.networkanalysis.PointBarrier
Represents a point 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
ConstructorDescriptionPointBarrier
(Point point) Creates an instance of PointBarrier with the given Point location. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getAddedCost
(String attributeName) Gets the added cost that was set.int
Gets the point barrier ID.Gets the curb approach that was set.Gets where the barrier is located on the map.Gets the status of where this barrier appears on the underlying transportation network.getName()
Gets the name of the barrier.getType()
Gets the type that was set.void
setAddedCost
(String attributeName, double addedCost) Sets the added cost for the barrier.void
setBarrierId
(int barrierId) Sets the point barrier ID.void
setCurbApproach
(CurbApproach curbApproach) Sets the curb approach.void
Sets the name of 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
-
PointBarrier
Creates an instance of PointBarrier with the given Point location.- Parameters:
point
- point where the barrier should be located- Throws:
IllegalArgumentException
- if point is null- Since:
- 100.0.0
-
-
Method Details
-
getBarrierId
public int getBarrierId()Gets the point barrier ID.This is a caller supplied foreign key that can be used to associate output point barriers with input point barriers.
- Returns:
- the point barrier ID
- Since:
- 100.6.0
- See Also:
-
setBarrierId
public void setBarrierId(int barrierId) Sets the point barrier ID.This is a caller supplied foreign key that can be used to associate output point barriers with input point barriers.
- Parameters:
barrierId
- the point barrier ID- Since:
- 100.6.0
- See Also:
-
getCurbApproach
Gets the curb approach that was set.- Returns:
- the curb approach. Default value is
CurbApproach.EITHER_SIDE
. - Since:
- 100.0.0
-
setCurbApproach
Sets the curb approach. Specifies how the restriction applies to the direction a vehicle may arrive at or depart from the barrier.- Parameters:
curbApproach
- curb approach- Throws:
IllegalArgumentException
- if curbApproach is nullArcGISRuntimeException
- if the curb approach isCurbApproach.NO_UTURN
- Since:
- 100.0.0
-
getType
Gets the type that was set.- Returns:
- the type. Default value is
BarrierType.RESTRICTION
. - 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
- the current type of this PointBarrier- Throws:
IllegalArgumentException
- if type is null- Since:
- 100.0.0
-
getAddedCost
Gets the added cost that was set.- Parameters:
attributeName
- attribute name. It can be empty. Null is treated as an empty string.- Returns:
- the added cost. Returns 0 if it was not set.
- Since:
- 100.0.0
-
setAddedCost
Sets the added cost for the barrier.- Parameters:
attributeName
- Name of the attribute used to calculate cost. It can be empty. Null is treated as an empty string.addedCost
- added cost- Since:
- 100.0.0
-
getLocationStatus
Gets the status of where this barrier appears on the underlying transportation network.- Returns:
- the location status. Returns
LocationStatus.NOT_LOCATED
by default. - Since:
- 100.0.0
-
getGeometry
Gets where the barrier is located on the map.- 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
-