Class Feature
- java.lang.Object
-
- com.github.filosganga.geogson.model.Feature
-
- All Implemented Interfaces:
Serializable
public class Feature extends Object implements Serializable
Feature is a collection of properties and a geometry Feature can contain properties with arbitrary json as the value. These values are returned as JsonElements and their serialization and de-serialization is left to the user. GeoJson reference: @see http://geojson.org/geojson-spec.html#feature-objects. eg:Feature f = Feature.of(polygon).withId(id)- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFeature.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Feature.Builderbuilder()static Feature.Builderbuilder(Feature feature)booleanequals(Object obj)Geometry<?>geometry()The Geometry of this Feature.inthashCode()Optional<String>id()The id of the Feature.static Featureof(Geometry<?> geometry)Map<String,com.google.gson.JsonElement>properties()The properties of this Feature.StringtoString()
-
-
-
Method Detail
-
builder
public static Feature.Builder builder()
-
builder
public static Feature.Builder builder(Feature feature)
-
of
public static Feature of(Geometry<?> geometry)
- Parameters:
geometry- The Geometry to build Feature from- Returns:
- An instance of Feature
-
geometry
public Geometry<?> geometry()
The Geometry of this Feature.- Returns:
- a Geometry instance.
-
properties
public Map<String,com.google.gson.JsonElement> properties()
The properties of this Feature.- Returns:
- an Map containing the properties. An empty map if not properties have been set.
-
id
public Optional<String> id()
The id of the Feature.- Returns:
- Optional.absent if this Feature does not have any id. A valued Optional otherwise.
-
-