Package com.mapbox.geojson
Interface GeoJson
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
CoordinateContainer<T>,Geometry
- All Known Implementing Classes:
Feature,FeatureCollection,GeometryCollection,LineString,MultiLineString,MultiPoint,MultiPolygon,Point,Polygon
Generic implementation for all GeoJson objects defining common traits that each GeoJson object
has. This logic is carried over to
Geometry which is an interface which all seven GeoJson
geometries implement.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbbox()A GeoJson object MAY have a member named "bbox" to include information on the coordinate range for its Geometries, Features, or FeatureCollections.toJson()This takes the currently defined values found inside the GeoJson instance and converts it to a GeoJson string.type()This describes the type of GeoJson geometry, Feature, or FeatureCollection this object is.
-
Method Details
-
type
String type()This describes the type of GeoJson geometry, Feature, or FeatureCollection this object is. Every GeoJson Object will have this defined once an instance is created and will never return null.- Returns:
- a String which describes the type of geometry, for this object it will always return
Feature - Since:
- 1.0.0
-
toJson
String toJson()This takes the currently defined values found inside the GeoJson instance and converts it to a GeoJson string.- Returns:
- a JSON string which represents this Feature
- Since:
- 1.0.0
-
bbox
BoundingBox bbox()A GeoJson object MAY have a member named "bbox" to include information on the coordinate range for its Geometries, Features, or FeatureCollections. The value of the bbox member MUST be an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries.- Returns:
- a double array with the length 2*n where n is the number of dimensions represented in the contained geometries
- Since:
- 3.0.0
-