public class CarmenFeature
extends com.mapbox.services.commons.geojson.Feature
Constructor and Description |
---|
CarmenFeature()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
com.mapbox.services.commons.models.Position |
asPosition()
Util to transform center into a Position object
|
static CarmenFeature |
fromJson(String json)
Create a CarmenFeature object from JSON.
|
String |
getAddress()
A string of the house number for the returned
address feature. |
double[] |
getBbox()
An array bounding box in the form
[minX, minY, maxX, maxY] . |
double[] |
getCenter()
An array in the form [longitude, latitude] at the center of the specified
bbox . |
List<CarmenContext> |
getContext()
An array representing the hierarchy of encompassing parent features.
|
String |
getLanguage()
A string of the IETF language tag of the query's primary language.
|
String |
getMatchingPlaceName()
A string analogous to the
getPlaceName() field that more closely matches the query than
results in the specified language. |
String |
getMatchingText()
A string analogous to the
text field that more closely matches the query than results in the specified
language. |
String |
getPlaceName()
A string representing the feature in the requested language, if specified, and its full result hierarchy.
|
String[] |
getPlaceType()
An array of feature types describing the feature.
|
double |
getRelevance()
You can use the relevance property to remove rough results if you require a response that
matches your whole query.
|
String |
getText()
A string representing the feature in the requested language, if specified.
|
void |
setAddress(String address)
Set a string of the house number for the returned
address feature. |
void |
setBbox(double[] bbox)
Set an array bounding box in the form
[minX, minY, maxX, maxY] . |
void |
setCenter(double[] center)
Set an array in the form [longitude, latitude] at the center of the specified
bbox . |
void |
setContext(List<CarmenContext> context)
Set an array representing the hierarchy of encompassing parent features.
|
void |
setLanguage(String language)
Set a string of the language tag of the query;s primary language.
|
void |
setMatchingPlaceName(String matchingPlaceName)
Set a string analogous to the
getPlaceName() field that more closely matches the query than
results in the specified language. |
void |
setMatchingText(String matchingText)
A string analogous to the
text field that more closely matches the query than results in the specified
language |
void |
setPlaceName(String placeName)
Set a string representing the feature in the requested language, if specified, and its full result hierarchy.
|
void |
setPlaceType(String[] placeType)
An array of feature types describing the feature.
|
void |
setRelevance(double relevance)
Set the relevance property to remove rough results if you require a response that matches your whole query.
|
void |
setText(String text)
Set a string representing the feature in the requested language, if specified.
|
String |
toString()
Human-readable text representing the full result hierarchy
(e.g.
|
addBooleanProperty, addCharacterProperty, addNumberProperty, addProperty, addStringProperty, fromGeometry, fromGeometry, fromGeometry, getBooleanProperty, getCharacterProperty, getGeometry, getId, getNumberProperty, getProperties, getProperty, getStringProperty, getType, hasNonNullValueForProperty, hasProperty, removeProperty, setGeometry, setId, setProperties, toJson
public String getText()
public void setText(String text)
text
- text representing the feature (e.g. "Austin")public String getPlaceName()
public void setPlaceName(String placeName)
placeName
- human-readable text representing the full result hierarchypublic double[] getBbox()
[minX, minY, maxX, maxY]
.public void setBbox(double[] bbox)
[minX, minY, maxX, maxY]
.bbox
- array bounding box of the form [minx, miny, maxx, maxy]public String getAddress()
address
feature. Note that unlike the address property for
poi
features, this property is outside the properties object.public void setAddress(String address)
address
feature.address
- Where applicable. While the string content isn't guaranteed, in many cases, this will be the house
number. If the response doesn't contain an address this will be null.public double[] getCenter()
bbox
.public void setCenter(double[] center)
bbox
.center
- array of the form [lon, lat]public List<CarmenContext> getContext()
public void setContext(List<CarmenContext> context)
context
- Array representing a hierarchy of parents. Each parent includes id, text keys.public double getRelevance()
public void setRelevance(double relevance)
relevance
- double value between 0 and 1public String getLanguage()
public void setLanguage(String language)
language
- locale object converted to a stringpublic String getMatchingPlaceName()
getPlaceName()
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 a matching_place_name of
"Köln, North Rhine-Westphalia, Germany".public void setMatchingPlaceName(String matchingPlaceName)
getPlaceName()
field that more closely matches the query than
results in the specified language.matchingPlaceName
- a string containing the matching place namepublic String getMatchingText()
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 the matching_text
"Köln".public void setMatchingText(String matchingText)
text
field that more closely matches the query than results in the specified
languagematchingText
- a string containing the matching textpublic String[] getPlaceType()
String
array containing the place typespublic void setPlaceType(String[] placeType)
placeType
- a String
array containing the place typespublic static CarmenFeature fromJson(String json)
json
- String of JSON making up a carmen feature.public com.mapbox.services.commons.models.Position asPosition()
Position
representing the center.© 2015–2016 Mapbox. All rights reserved.