Package org.bremersee.geojson
Class AbstractGeoJsonFeature<G,P>
- java.lang.Object
-
- org.bremersee.common.model.UnknownAware
-
- org.bremersee.geojson.AbstractGeoJsonFeature<G,P>
-
- Type Parameters:
G- the geometry type parameterP- the properties type parameter
- Direct Known Subclasses:
GeoJsonFeature
public abstract class AbstractGeoJsonFeature<G,P> extends org.bremersee.common.model.UnknownAwareA GeoJSON object with the typeFeature(see rfc7946 section 3.3).- Author:
- Christian Bremer
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGeoJsonFeature()Instantiates a new abstract geo json feature.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleanequals(G g1, Object g2)Equals boolean.booleanequals(Object o)double[]getBbox()Return the bounding box of the GeoJSON object ornullif there is no such object (see Bounding Box).abstract GgetGeometry()Return the geometry object of this GeoJSON feature.abstract StringgetId()Return the id of this GeoJSON feature ornullif there is no id available.PgetProperties()Return the properties that are associated with this GeoJSON feature ornullif there are no properties.inthashCode()voidsetBbox(double[] bbox)Set the bounding box of the GeoJSON object.abstract voidsetGeometry(G geometry)Set the geometry object of this GeoJSON feature.abstract voidsetId(String id)Set the id of this GeoJSON feature.voidsetProperties(P properties)Set the properties that are associated with this GeoJSON feature.StringtoString()
-
-
-
Method Detail
-
getId
public abstract String getId()
Return the id of this GeoJSON feature ornullif there is no id available.- Returns:
- the id of this GeoJSON feature
-
setId
public abstract void setId(String id)
Set the id of this GeoJSON feature.- Parameters:
id- the id of this GeoJSON feature
-
getGeometry
public abstract G getGeometry()
Return the geometry object of this GeoJSON feature.- Returns:
- the geometry
-
setGeometry
public abstract void setGeometry(G geometry)
Set the geometry object of this GeoJSON feature.- Parameters:
geometry- the geometry to set
-
getBbox
public double[] getBbox()
Return the bounding box of the GeoJSON object ornullif there is no such object (see Bounding Box).- Returns:
- the bounding box
-
setBbox
public void setBbox(double[] bbox)
Set the bounding box of the GeoJSON object.- Parameters:
bbox- the bounding box to set
-
getProperties
public P getProperties()
Return the properties that are associated with this GeoJSON feature ornullif there are no properties.- Returns:
- the properties of this feature
-
setProperties
public void setProperties(P properties)
Set the properties that are associated with this GeoJSON feature.Be aware that each object must be serializable with the Jackson JSON processor.
- Parameters:
properties- the properties of this feature
-
toString
public String toString()
- Overrides:
toStringin classorg.bremersee.common.model.UnknownAware
-
hashCode
public int hashCode()
- Overrides:
hashCodein classorg.bremersee.common.model.UnknownAware
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classorg.bremersee.common.model.UnknownAware
-
-