public class StepIntersection extends Object
Constructor and Description |
---|
StepIntersection()
Empty constructor
|
StepIntersection(IntersectionLanes[] lanes)
Constructor allowing the setting of the
IntersectionLanes . |
Modifier and Type | Method and Description |
---|---|
com.mapbox.services.commons.models.Position |
asPosition()
Converts double array
getLocation() to a Position . |
int[] |
getBearings()
An integer array of bearing values available at the step intersection.
|
boolean[] |
getEntry()
An array of entry flags, corresponding in a 1:1 relationship to the bearings.
|
int |
getIn()
Index into bearings/entry array.
|
IntersectionLanes[] |
getLanes()
Array of lane objects that represent the available turn lanes at the intersection.
|
double[] |
getLocation()
A double array of length 2, first position being the longitude and the other being latitude.
|
int |
getOut()
Index out of the bearings/entry array.
|
void |
setBearings(int[] bearings)
An integer array of bearing values available at the step intersection.
|
void |
setEntry(boolean[] entry)
An array of entry flags, corresponding in a 1:1 relationship to the bearings.
|
void |
setIn(int in)
Index into bearings/entry array.
|
void |
setLanes(IntersectionLanes[] lanes)
Array of lane objects that represent the available turn lanes at the intersection.
|
void |
setLocation(double[] location)
A double array of length 2, first position being the longitude and the other being latitude.
|
void |
setOut(int out)
Index out of the bearings/entry array.
|
public StepIntersection()
public StepIntersection(IntersectionLanes[] lanes)
IntersectionLanes
.lanes
- an Array of IntersectionLanes
.public double[] getLocation()
public void setLocation(double[] location)
location
- array with the order [longitude, latitude].public int[] getBearings()
public void setBearings(int[] bearings)
bearings
- an array of bearing values (for example [0,90,180,270]) that are available at the
intersection. The bearings describe all available roads at the intersection.public boolean[] getEntry()
public void setEntry(boolean[] entry)
entry
- an array of entry flags, corresponding in a 1:1 relationship to the bearings. A value
of true indicates that the respective road could be entered on a valid route. false
indicates that the turn onto the respective road would violate a restriction.public int getIn()
public void setIn(int in)
in
- index into bearings/entry array. Used to calculate the bearing before the turn.
Namely, the clockwise angle from true north to the direction of travel before the
maneuver/passing the intersection. To get the bearing in the direction of driving,
the bearing has to be rotated by a value of 180. The value is not supplied for departure
maneuvers.public int getOut()
public void setOut(int out)
out
- index out of the bearings/entry array. Used to extract the bearing after the turn.
Namely, The clockwise angle from true north to the direction of travel after the
maneuver/passing the intersection. The value is not supplied for arrive maneuvers.public com.mapbox.services.commons.models.Position asPosition()
getLocation()
to a Position
. You'll typically want to
use this format instead of getLocation()
as it's easier to work with.Position
.public IntersectionLanes[] getLanes()
public void setLanes(IntersectionLanes[] lanes)
lanes
- an array of lane objects that represent the available turn lanes at the intersection. If
no lane information is available for an intersection, the lanes property will not be present.
Lanes are provided in their order on the street, from left to right.© 2015–2016 Mapbox. All rights reserved.