public abstract static class MapboxIsochrone.Builder
extends java.lang.Object
Note to contributors: All optional booleans in this builder use the object Boolean
rather than the primitive to allow for unset (null) values.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract MapboxIsochrone.Builder |
accessToken(java.lang.String accessToken)
A valid Mapbox access token.
|
MapboxIsochrone.Builder |
addContoursColors(java.lang.String... contoursColors)
A list of separate String which has a list of comma-separated
HEX color values to use for each isochrone contour.
|
MapboxIsochrone.Builder |
addContoursMinutes(java.lang.Integer... listOfMinuteValues)
An integer list of minute values to use for each isochrone contour.
|
abstract MapboxIsochrone.Builder |
baseUrl(java.lang.String baseUrl)
Optionally change the APIs base URL to something other then the default Mapbox one.
|
MapboxIsochrone |
build()
Build a new
MapboxIsochrone object. |
MapboxIsochrone.Builder |
coordinates(com.mapbox.geojson.Point queryPoint)
A
Point object which represents a {longitude,latitude} coordinate
pair around which to center the isochrone lines. |
abstract MapboxIsochrone.Builder |
coordinates(java.lang.String queryPoint)
A string which represents a {longitude,latitude} coordinate pair
around which to center the isochrone lines.
|
abstract MapboxIsochrone.Builder |
denoise(java.lang.Float denoise)
A floating point value from 0.0 to 1.0 that can be used to remove smaller contours.
|
abstract MapboxIsochrone.Builder |
generalize(java.lang.Float generalize)
A positive floating point value in meters used as the tolerance for Douglas-Peucker
generalization.
|
abstract MapboxIsochrone.Builder |
polygons(java.lang.Boolean polygons)
Specify whether to return the contours as GeoJSON
Polygon (true) or LineString (false). |
abstract MapboxIsochrone.Builder |
profile(java.lang.String profile)
A Mapbox Directions routing profile ID.
|
abstract MapboxIsochrone.Builder |
user(java.lang.String user)
The username for the account that the Isochrone engine runs on.
|
public abstract MapboxIsochrone.Builder baseUrl(@NonNull java.lang.String baseUrl)
baseUrl - base url used as end pointpublic abstract MapboxIsochrone.Builder accessToken(@NonNull java.lang.String accessToken)
accessToken - the Mapbox access token to use for the Isochrone API callpublic abstract MapboxIsochrone.Builder user(@NonNull java.lang.String user)
IsochroneCriteria.PROFILE_DEFAULT_USER.user - a non-null string which will replace the default user used in the Isochrone
requestpublic abstract MapboxIsochrone.Builder profile(@Nullable java.lang.String profile)
IsochroneCriteria.PROFILE_DRIVING for travel times by car,
IsochroneCriteria.PROFILE_WALKING for pedestrian and hiking travel times,
and IsochroneCriteria.PROFILE_CYCLING for travel times by bicycle.profile - a Mapbox Directions profilepublic MapboxIsochrone.Builder coordinates(@NonNull com.mapbox.geojson.Point queryPoint)
Point object which represents a {longitude,latitude} coordinate
pair around which to center the isochrone lines.queryPoint - center query point for the isochrone calculationpublic abstract MapboxIsochrone.Builder coordinates(@NonNull java.lang.String queryPoint)
queryPoint - center query point for the isochrone calculationpublic MapboxIsochrone.Builder addContoursMinutes(@NonNull java.lang.Integer... listOfMinuteValues)
listOfMinuteValues - an integer list with at least one number
for the minutes which represent each contourpublic MapboxIsochrone.Builder addContoursColors(@Nullable java.lang.String... contoursColors)
For example, .contoursColors("6706ce","04e813","4286f4")
The colors should be specified as hex values without a leading # (for example, ff0000 for red). If this parameter is used, there must be the same number of colors as there are entries in contours_minutes. If no colors are specified, the Isochrone API will assign a default rainbow color scheme to the output.
contoursColors - the list of at least one color value to use for
the polygon fill areas in the API responsepublic abstract MapboxIsochrone.Builder polygons(@Nullable java.lang.Boolean polygons)
Polygon (true) or LineString (false).
If no boolean is set, false is the default, which results in
LineString being delivered.
When polygons=true, any contour that forms a ring is returned as
a Polygon.
polygons - a boolean whether you want the API response to include
Polygon geometries to represent the
various contours.public abstract MapboxIsochrone.Builder denoise(@Nullable java.lang.Float denoise)
denoise - an optional number to determine the shape of small contourspublic abstract MapboxIsochrone.Builder generalize(@Nullable java.lang.Float generalize)
generalize - an optional number to determine how smooth or jagged the contour
lines/polygons contours arepublic MapboxIsochrone build()
MapboxIsochrone object.