java.lang.Object
org.evomaster.client.java.controller.mongo.geometry.GeoJsonUtils

public abstract class GeoJsonUtils extends Object
  • Constructor Details

    • GeoJsonUtils

      public GeoJsonUtils()
  • Method Details

    • isGeoJsonPoint

      public static boolean isGeoJsonPoint(Object document)
      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:
      true if the object represents a valid GeoJSON Point, false otherwise.
      Throws:
      NullPointerException - if the provided document is null.
      IllegalArgumentException - if the provided document is not a BSON document.
    • toGeoJsonPoint

      public static GeoJsonPoint toGeoJsonPoint(Object document)
      Converts an object representing a valid GeoJSON Point into a GeoJsonPoint instance. 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 a GeoJsonPoint. Must represent a valid GeoJSON Point.
      Returns:
      a GeoJsonPoint constructed from the longitude and latitude values in the provided document.
      Throws:
      IllegalArgumentException - if the provided object is not a valid GeoJSON Point.