Class GeoJsonUtils
java.lang.Object
org.evomaster.client.java.controller.mongo.geometry.GeoJsonUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisGeoJsonPoint(Object document) Checks whether the given object represents a GeoJSON Point.static GeoJsonPointtoGeoJsonPoint(Object document) Converts an object representing a valid GeoJSON Point into aGeoJsonPointinstance.
-
Constructor Details
-
GeoJsonUtils
public GeoJsonUtils()
-
-
Method Details
-
isGeoJsonPoint
Checks whether the given object represents a GeoJSON Point. A valid GeoJSON Point must be a BSON document with the "type" field set to "Point" and a "coordinates" field containing a list of exactly two numerical values: longitude and latitude.- Parameters:
document- the object to validate as a GeoJSON Point. Must be a BSON document.- Returns:
trueif the object represents a valid GeoJSON Point,falseotherwise.- Throws:
NullPointerException- if the provided document isnull.IllegalArgumentException- if the provided document is not a BSON document.
-
toGeoJsonPoint
Converts an object representing a valid GeoJSON Point into aGeoJsonPointinstance. The input object must be a BSON document containing a "type" field with the value "Point" and a "coordinates" field with a list of exactly two numerical values: longitude and latitude.- Parameters:
document- the BSON document to convert to aGeoJsonPoint. Must represent a valid GeoJSON Point.- Returns:
- a
GeoJsonPointconstructed from the longitude and latitude values in the provided document. - Throws:
IllegalArgumentException- if the provided object is not a valid GeoJSON Point.
-