| Modifier and Type | Method and Description |
|---|---|
Feature.Builder |
bbox(double[] bbox)
Set the optional
bbox (bounding box) field of this feature. |
Feature |
build()
Return a new GeoJSON feature.
|
Feature.Builder |
id(int id)
Set the optional
id field of this feature as an integer. |
Feature.Builder |
id(String id)
Set the optional
id field of this feature as a string. |
Feature.Builder |
properties(Map<String,?> properties)
Set the properties of this feature.
|
String |
toJson()
Return the serialized form of a new GeoJSON feature.
|
void |
write(Path path)
Write the serialized form of a new GeoJSON feature to the file at
path. |
public Feature.Builder id(int id)
id field of this feature as an integer.id - to setpublic Feature.Builder id(String id)
id field of this feature as a string.id - to setpublic Feature.Builder bbox(double[] bbox)
bbox (bounding box) field of this feature. See
the GeoJSON specification
bbox - to setIllegalArgumentpublic Feature.Builder properties(Map<String,?> properties)
properties - to setpublic Feature build()
public String toJson()
IllegalStateException - if builder is emptypublic void write(Path path) throws IOException
path.IllegalStateException - if builder is emptyIOException