Package org.bremersee.geojson
Class GeoJsonFeature
- java.lang.Object
-
- org.bremersee.common.model.UnknownAware
-
- org.bremersee.geojson.AbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>>
-
- org.bremersee.geojson.GeoJsonFeature
-
- All Implemented Interfaces:
Serializable
public class GeoJsonFeature extends AbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>> implements Serializable
A GeoJSON object with the typeFeature(see rfc7946 section 3.2).- Author:
- Christian Bremer
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GeoJsonFeature()Default constructor.GeoJsonFeature(String id, org.locationtech.jts.geom.Geometry geometry, boolean calculateBounds, Map<String,Object> properties)Constructs a GeoJSON feature with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanequals(org.locationtech.jts.geom.Geometry g1, Object g2)Equals boolean.org.locationtech.jts.geom.GeometrygetGeometry()Return the geometry object of this GeoJSON feature.StringgetId()Return the id of this GeoJSON feature ornullif there is no id available.Map<String,Object>getProperties()Return the properties that are associated with this GeoJSON feature ornullif there are no properties.voidsetGeometry(org.locationtech.jts.geom.Geometry geometry)Set the geometry object of this GeoJSON feature.voidsetId(String id)Set the id of this GeoJSON feature.-
Methods inherited from class org.bremersee.geojson.AbstractGeoJsonFeature
equals, getBbox, hashCode, setBbox, setProperties, toString
-
-
-
-
Constructor Detail
-
GeoJsonFeature
public GeoJsonFeature()
Default constructor.
-
GeoJsonFeature
public GeoJsonFeature(String id, org.locationtech.jts.geom.Geometry geometry, boolean calculateBounds, Map<String,Object> properties)
Constructs a GeoJSON feature with the specified parameters.- Parameters:
id- an optional idgeometry- the geometry of the GeoJson featurecalculateBounds- iftruethe bounding box will be calculated otherwise the bounding box will benullproperties- a map with named objects that are associated with the GeoJSON feature
-
-
Method Detail
-
getId
public String getId()
Description copied from class:AbstractGeoJsonFeatureReturn the id of this GeoJSON feature ornullif there is no id available.- Specified by:
getIdin classAbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>>- Returns:
- the id of this GeoJSON feature
-
setId
public void setId(String id)
Description copied from class:AbstractGeoJsonFeatureSet the id of this GeoJSON feature.- Specified by:
setIdin classAbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>>- Parameters:
id- the id of this GeoJSON feature
-
getGeometry
public org.locationtech.jts.geom.Geometry getGeometry()
Description copied from class:AbstractGeoJsonFeatureReturn the geometry object of this GeoJSON feature.- Specified by:
getGeometryin classAbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>>- Returns:
- the geometry
-
setGeometry
public void setGeometry(org.locationtech.jts.geom.Geometry geometry)
Description copied from class:AbstractGeoJsonFeatureSet the geometry object of this GeoJSON feature.- Specified by:
setGeometryin classAbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>>- Parameters:
geometry- the geometry to set
-
getProperties
public Map<String,Object> getProperties()
Description copied from class:AbstractGeoJsonFeatureReturn the properties that are associated with this GeoJSON feature ornullif there are no properties.- Overrides:
getPropertiesin classAbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>>- Returns:
- the properties of this feature
-
equals
protected boolean equals(org.locationtech.jts.geom.Geometry g1, Object g2)Description copied from class:AbstractGeoJsonFeatureEquals boolean.- Specified by:
equalsin classAbstractGeoJsonFeature<org.locationtech.jts.geom.Geometry,Map<String,Object>>- Parameters:
g1- the g 1g2- the g 2- Returns:
- the boolean
-
-