| Modifier and Type | Class and Description |
|---|---|
static class |
Feature.Builder
A single-use feature builder.
|
| Modifier and Type | Method and Description |
|---|---|
LocationList |
asLineString()
Return the geometry of this feature as a line string.
|
Location |
asPoint()
Return the geometry of this feature as a point.
|
LocationList |
asPolygonBorder()
Return the border of this polygon feature.
|
double[] |
bbox()
The bounding box value array; may be
null. |
boolean |
hasId()
Return whether this feature has a non-null 'id' member.
|
int |
idAsInt()
The 'id' of this feature as an integer.
|
String |
idAsString()
The 'id' of this feature as a string.
|
static Feature.Builder |
lineString(LocationList line)
Create a single-use line string feature builder.
|
static Feature.Builder |
point(Location location)
Create a single-use point feature builder.
|
static Feature.Builder |
polygon(LocationList exterior,
LocationList... interiors)
Create a single-use polygon feature builder.
|
Properties |
properties()
Get the property map associated with this feature as a
Properties
helper object. |
GeoJson.Type |
type()
The GeoJSON geometry type of this feature, one of:
[POINT, LINE_STRING, POLYGON]. |
public static Feature.Builder point(Location location)
location - of pointpublic static Feature.Builder lineString(LocationList line)
line - locationspublic static Feature.Builder polygon(LocationList exterior, LocationList... interiors)
exterior - linear ring boundary of polygoninteriors - optional interior linear ringspublic boolean hasId()
public String idAsString()
NullPointerException - if this feature does not contain an 'id'
member. Use hasId() to test whether 'id' member exists.public int idAsInt()
NullPointerException - if this feature does not contain an 'id'
member. Use hasId() to test whether 'id' member exists.public double[] bbox()
null.public Properties properties()
Properties
helper object. May be null or empty.public GeoJson.Type type()
[POINT, LINE_STRING, POLYGON].GeoJson.Typepublic Location asPoint()
UnsupportedOperationException - if feature is not a point.public LocationList asLineString()
UnsupportedOperationException - if feature is not a line string.public LocationList asPolygonBorder()
UnsupportedOperationException - if feature is not a polygon.