public abstract static class NbmapMapMatching.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract NbmapMapMatching.Builder |
accessToken(java.lang.String accessToken)
Required to call when this is being built.
|
NbmapMapMatching.Builder |
addApproaches(java.lang.String... approaches)
Optionally used to indicate how map matched routes consider
rom which side of the road to approach a waypoint.
|
NbmapMapMatching.Builder |
addWaypointNames(java.lang.String... waypointNames)
Custom names for waypoints used for the arrival instruction,
each separated by ; .
|
NbmapMapMatching.Builder |
annotations(java.lang.String... annotations)
Whether or not to return additional metadata along the route.
|
protected abstract NbmapMapMatching.Builder |
annotations(java.lang.String annotations) |
protected abstract NbmapMapMatching |
autoBuild() |
abstract NbmapMapMatching.Builder |
bannerInstructions(java.lang.Boolean bannerInstructions)
Setting this will determine Whether or not to return banner objects associated with
the `routeSteps`.
|
abstract NbmapMapMatching.Builder |
baseUrl(java.lang.String baseUrl)
Optionally change the APIs base URL to something other then the default Nbmap one.
|
NbmapMapMatching |
build()
This uses the provided parameters set using the
NbmapMapMatching.Builder and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new NbmapMapMatching object with the values provided. |
abstract NbmapMapMatching.Builder |
clientAppName(java.lang.String clientAppName)
Base package name or other simple string identifier.
|
NbmapMapMatching.Builder |
coordinate(com.nbmap.geojson.Point coordinate)
This will add a single
Point to the coordinate list which is used to determine the
duration between points. |
NbmapMapMatching.Builder |
coordinates(java.util.List<com.nbmap.geojson.Point> coordinates)
Add a list of
Point's which define the points to perform the map matching on. |
protected abstract NbmapMapMatching.Builder |
coordinates(java.lang.String coordinates) |
abstract NbmapMapMatching.Builder |
geometries(java.lang.String geometries)
alter the default geometry being returned for the map matching route.
|
NbmapMapMatching.Builder |
get()
Use GET method to request data.
|
NbmapMapMatching.Builder |
language(java.util.Locale language)
Set the instruction language for the map matching request, the default is english.
|
abstract NbmapMapMatching.Builder |
language(java.lang.String language)
Set the instruction language for the map matching request, the default is english.
|
abstract NbmapMapMatching.Builder |
overview(java.lang.String overview)
Type of returned overview geometry.
|
NbmapMapMatching.Builder |
post()
Use POST method to request data.
|
abstract NbmapMapMatching.Builder |
profile(java.lang.String profile)
This selects which mode of transportation the user will be using to accurately give the
map matching route.
|
NbmapMapMatching.Builder |
radiuses(java.lang.Double... radiuses)
Optionally, set the maximum distance in meters that each coordinate is allowed to move when
snapped to a nearby road segment.
|
abstract NbmapMapMatching.Builder |
roundaboutExits(java.lang.Boolean roundaboutExits)
Setting this will determine whether to return steps and turn-by-turn instructions.
|
abstract NbmapMapMatching.Builder |
steps(java.lang.Boolean steps)
Setting this will determine whether to return steps and turn-by-turn instructions.
|
abstract NbmapMapMatching.Builder |
tidy(java.lang.Boolean tidy)
Whether or not to transparently remove clusters and re-sample traces for improved map
matching results.
|
NbmapMapMatching.Builder |
timestamps(java.lang.String... timestamps)
Timestamps corresponding to each coordinate provided in the request; must be numbers in Unix
time (seconds since the Unix epoch) converted to a String.
|
protected abstract NbmapMapMatching.Builder |
timestamps(java.lang.String timestamps) |
abstract NbmapMapMatching.Builder |
user(java.lang.String user)
The username for the account that the directions engine runs on.
|
abstract NbmapMapMatching.Builder |
voiceInstructions(java.lang.Boolean voiceInstructions)
Setting this will determine whether to return steps and turn-by-turn instructions.
|
abstract NbmapMapMatching.Builder |
voiceUnits(java.lang.String voiceUnits)
Specify what unit you'd like voice and banner instructions to use.
|
NbmapMapMatching.Builder |
waypointIndices(java.lang.Integer... waypointIndices)
Optionally, set which input coordinates should be treated as waypoints / separate legs.
|
NbmapMapMatching.Builder |
waypoints(java.lang.Integer... waypoints)
Deprecated.
you should now use
waypointIndices(Integer[]) |
public NbmapMapMatching.Builder post()
public NbmapMapMatching.Builder get()
public abstract NbmapMapMatching.Builder accessToken(@NonNull java.lang.String accessToken)
ServicesException will be thrown.accessToken - Nbmap access token, You must have a Nbmap account inorder to use
the Map Matching APIpublic abstract NbmapMapMatching.Builder tidy(@Nullable java.lang.Boolean tidy)
tidy - true if you'd like the API to remove coordinates clustered together, otherwise
falsepublic abstract NbmapMapMatching.Builder user(@NonNull java.lang.String user)
DirectionsCriteria.PROFILE_DEFAULT_USER.user - a non-null string which will replace the default user used in the map matching
requestpublic abstract NbmapMapMatching.Builder profile(@NonNull java.lang.String profile)
profile - required to be one of the String values found in the DirectionsCriteria.ProfileCriteriapublic abstract NbmapMapMatching.Builder geometries(@Nullable java.lang.String geometries)
DirectionsCriteria.GEOMETRY_POLYLINE6.
Note that while the API supports GeoJson as an option for geometry, this SDK intentionally removes this as an option since an encoded string for the geometry significantly reduces bandwidth on mobile devices and speeds up response time.
geometries - null if you'd like the default geometry, else one of the options found in
DirectionsCriteria.GeometriesCriteria.public NbmapMapMatching.Builder radiuses(@Nullable java.lang.Double... radiuses)
Double.POSITIVE_INFINITY.
If no routable road is found within the radius, a NoSegment error is returned.
radiuses - double array containing the radiuses defined in unit meters.@Deprecated public NbmapMapMatching.Builder waypoints(@Nullable java.lang.Integer... waypoints)
waypointIndices(Integer[])
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates' index separated by ; .
NbmapMapMatching.steps()
waypoints - integer array of coordinate indices to be used as waypointspublic NbmapMapMatching.Builder waypointIndices(@Nullable java.lang.Integer... waypointIndices)
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates' index separated by ; .
NbmapMapMatching.steps()
waypointIndices - integer array of coordinate indices to be used as waypointspublic abstract NbmapMapMatching.Builder steps(@Nullable java.lang.Boolean steps)
steps - true if you'd like step informationpublic abstract NbmapMapMatching.Builder overview(@Nullable java.lang.String overview)
DirectionsCriteria.OVERVIEW_FULL (the most
detailed geometry available), DirectionsCriteria.OVERVIEW_SIMPLIFIED (a simplified
version of the full geometry), or DirectionsCriteria.OVERVIEW_FALSE (no overview
geometry). The default is simplified. Passing in null will use the APIs default setting for
the overview field.overview - null or one of the options found in DirectionsCriteria.OverviewCriteriapublic abstract NbmapMapMatching.Builder bannerInstructions(@Nullable java.lang.Boolean bannerInstructions)
bannerInstructions - true if you'd like step informationpublic abstract NbmapMapMatching.Builder voiceInstructions(@Nullable java.lang.Boolean voiceInstructions)
voiceInstructions - true if you'd like step informationpublic abstract NbmapMapMatching.Builder voiceUnits(@Nullable java.lang.String voiceUnits)
voiceUnits - either Imperial (default) or Metricpublic abstract NbmapMapMatching.Builder roundaboutExits(@Nullable java.lang.Boolean roundaboutExits)
roundaboutExits - true if you'd like step informationpublic NbmapMapMatching.Builder annotations(@Nullable java.lang.String... annotations)
DirectionsCriteria.ANNOTATION_DISTANCE,
DirectionsCriteria.ANNOTATION_DURATION,
DirectionsCriteria.ANNOTATION_DURATION and
DirectionsCriteria.ANNOTATION_CONGESTION.annotations - string referencing one of the annotation direction criteria's. The strings
restricted to one or multiple values inside the DirectionsCriteria.AnnotationCriteria
or null which will result in no annotations being usedprotected abstract NbmapMapMatching.Builder annotations(@Nullable java.lang.String annotations)
public NbmapMapMatching.Builder timestamps(@Nullable java.lang.String... timestamps)
timestamps - timestamp corresponding to the coordinate added at the identical indexprotected abstract NbmapMapMatching.Builder timestamps(@Nullable java.lang.String timestamps)
public NbmapMapMatching.Builder coordinates(@NonNull java.util.List<com.nbmap.geojson.Point> coordinates)
Point's which define the points to perform the map matching on. The
minimum points is 2 and the maximum points allowed in totals 100. You can use this method in
conjunction with coordinate(Point).coordinates - a List full of Points which define the points to perform the map
matching onprotected abstract NbmapMapMatching.Builder coordinates(@NonNull java.lang.String coordinates)
public NbmapMapMatching.Builder coordinate(@NonNull com.nbmap.geojson.Point coordinate)
Point to the coordinate list which is used to determine the
duration between points. This can be called up to 100 times until you hit the maximum allowed
points. You can use this method in conjunction with coordinates(List).coordinate - a Point which you'd like the map matching APi to perform onpublic NbmapMapMatching.Builder language(@Nullable java.util.Locale language)
language - a Locale value representing the language you'd like the instructions to be
written in when returnedpublic abstract NbmapMapMatching.Builder language(java.lang.String language)
language - a String value representing the language you'd like the instructions to be
written in when returnedpublic abstract NbmapMapMatching.Builder clientAppName(@NonNull java.lang.String clientAppName)
clientAppName - base package name or other simple string identifierpublic NbmapMapMatching.Builder addApproaches(@Nullable java.lang.String... approaches)
approaches - null if you'd like the default approaches,
else one of the options found in
DirectionsCriteria.ApproachesCriteria.public NbmapMapMatching.Builder addWaypointNames(@Nullable java.lang.String... waypointNames)
waypointNames - Custom names for waypoints used for the arrival instruction.public abstract NbmapMapMatching.Builder baseUrl(java.lang.String baseUrl)
baseUrl - base url used as end pointprotected abstract NbmapMapMatching autoBuild()
public NbmapMapMatching build()
NbmapMapMatching.Builder and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new NbmapMapMatching object with the values provided.com.nbmap.core.exceptions.ServicesException - when a provided parameter is detected to be incorrect