public abstract class CarmenFeature
extends java.lang.Object
implements com.mapbox.geojson.GeoJson
GeoJson
object in GeoJSON and adds several additional attribute
which further describe the geocoding result.
A Geocoding id is a String in the form {type}.{id}
where {type}
is the lowest
hierarchy feature in the place_type field. The {id} suffix of the feature id is unstable and
may change within versions.
Note: this class doesn't actually extend Feature due to the inherit rule in AutoValue (see link below).
Modifier and Type | Class and Description |
---|---|
static class |
CarmenFeature.Builder
This builder can be used to set the values describing the
CarmenFeature . |
Constructor and Description |
---|
CarmenFeature() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
address()
A string of the house number for the returned
address feature. |
abstract com.mapbox.geojson.BoundingBox |
bbox()
A
CarmenFeature might have a member named bbox to include information on the
coordinate range for it's Geometry . |
static CarmenFeature.Builder |
builder()
Create a new instance of this class by using the
CarmenFeature.Builder class. |
com.mapbox.geojson.Point |
center()
A
Point object which represents the center point inside the bbox() if one is
provided. |
abstract java.util.List<CarmenContext> |
context()
A list representing the hierarchy of encompassing parent features.
|
static CarmenFeature |
fromJson(java.lang.String json)
Create a CarmenFeature object from JSON.
|
abstract com.mapbox.geojson.Geometry |
geometry()
The geometry which makes up this feature.
|
abstract java.lang.String |
id()
A feature may have a commonly used identifier which is either a unique String or number.
|
abstract java.lang.String |
language()
A string of the IETF language tag of the query's primary language.
|
abstract java.lang.String |
matchingPlaceName()
A string analogous to the
placeName() field that more closely matches the query than
results in the specified language. |
abstract java.lang.String |
matchingText()
A string analogous to the
text() field that more closely matches the query than
results in the specified language. |
abstract java.lang.String |
placeName()
A string representing the feature in the requested language, if specified, and its full result
hierarchy.
|
abstract java.util.List<java.lang.String> |
placeType()
A list of feature types describing the feature.
|
abstract com.google.gson.JsonObject |
properties()
This contains the JSON object which holds the feature properties.
|
abstract java.lang.Double |
relevance()
A numerical score from 0 (least relevant) to 0.99 (most relevant) measuring how well each
returned feature matches the query.
|
abstract java.lang.String |
text()
A string representing the feature in the requested language, if specified.
|
abstract CarmenFeature.Builder |
toBuilder()
Convert current instance values into another Builder to quickly change one or more values.
|
java.lang.String |
toJson()
This takes the currently defined values found inside this instance and converts it to a JSON
string.
|
abstract java.lang.String |
type()
This describes the TYPE of GeoJson geometry this object is, thus this will always return
Feature . |
static com.google.gson.TypeAdapter<CarmenFeature> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
@NonNull public static CarmenFeature fromJson(@NonNull java.lang.String json)
json
- string of JSON making up a carmen feature@NonNull public static CarmenFeature.Builder builder()
CarmenFeature.Builder
class.CarmenFeature.Builder
for creating a new instance@NonNull @SerializedName(value="type") public abstract java.lang.String type()
Feature
.type
in interface com.mapbox.geojson.GeoJson
Feature
@Nullable public abstract com.mapbox.geojson.BoundingBox bbox()
CarmenFeature
might have a member named bbox
to include information on the
coordinate range for it's Geometry
. The value of the bbox member MUST be a list of
size 2*n where n is the number of dimensions represented in the contained feature geometries,
with all axes of the most southwesterly point followed by all axes of the more northeasterly
point. The axes order of a bbox follows the axes order of geometries.bbox
in interface com.mapbox.geojson.GeoJson
BoundingBox
object containing the information@Nullable public abstract java.lang.String id()
@Nullable public abstract com.mapbox.geojson.Geometry geometry()
Geometry
which makes this feature spatially aware@Nullable public abstract com.google.gson.JsonObject properties()
JsonObject
and might be empty if no properties are provided.JsonObject
which holds this features current properties@Nullable public abstract java.lang.String text()
@Nullable @SerializedName(value="place_name") public abstract java.lang.String placeName()
@Nullable @SerializedName(value="place_type") public abstract java.util.List<java.lang.String> placeType()
GeocodingCriteria.GeocodingTypeCriteria
. Most features have only one type, but if the feature has
multiple types, (for example, Vatican City is a country, region, and place), all applicable
types will be provided in the list.@Nullable public abstract java.lang.String address()
address
feature. Note that unlike the
address property for poi
features, this property is outside the properties object.@Nullable public com.mapbox.geojson.Point center()
Point
object which represents the center point inside the bbox()
if one is
provided.Point
which defines the center location of this feature@Nullable public abstract java.util.List<CarmenContext> context()
CarmenContext
which might contain additional information
about this specific feature@Nullable public abstract java.lang.Double relevance()
@Nullable @SerializedName(value="matching_text") public abstract java.lang.String matchingText()
text()
field that more closely matches the query than
results in the specified language. For example, querying "Köln, Germany" with
language set to English might return a feature with the text()
"Cologne"
and this would be "Köln".@Nullable @SerializedName(value="matching_place_name") public abstract java.lang.String matchingPlaceName()
placeName()
field that more closely matches the query than
results in the specified language. For example, querying "Köln, Germany" with language
set to English might return a feature with the placeName()
"Cologne, Germany"
and this would return "Köln, North Rhine-Westphalia, Germany".@Nullable public abstract java.lang.String language()
public static com.google.gson.TypeAdapter<CarmenFeature> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
objectpublic java.lang.String toJson()
toJson
in interface com.mapbox.geojson.GeoJson
public abstract CarmenFeature.Builder toBuilder()
CarmenFeature
using the newly defined values