Class Point

  • All Implemented Interfaces:
    Geometry

    @Embedded
    public class Point
    extends java.lang.Object
    implements Geometry
    Represents a GeoJSON Point type. Will be persisted into the database according to the specification. Therefore because of this, this entity will never have its own ID or store the its Class name.

    The builder for creating a Point is the GeoJson.pointBuilder method, or the helper GeoJson.point factory method.

    See Also:
    GeoJson.point(double, double)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.mongodb.client.model.geojson.Point convert()
      Converts this type to the driver type
      com.mongodb.client.model.geojson.Point convert​(CoordinateReferenceSystem crs)
      Converts this type to the driver type
      boolean equals​(java.lang.Object o)  
      java.util.List<java.lang.Double> getCoordinates()
      Returns a list of coordinates for this Geometry type.
      double getLatitude()
      Return the latitude of this point.
      double getLongitude()
      Return the longitude of this point.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getCoordinates

        public java.util.List<java.lang.Double> getCoordinates()
        Description copied from interface: Geometry
        Returns a list of coordinates for this Geometry type. For something like a Point, this will be a pair of lat/long coordinates, but for more complex types this will be a list of other Geometry objects. Used for serialisation to MongoDB.
        Specified by:
        getCoordinates in interface Geometry
        Returns:
        a List containing either Geometry objects, or a pair of coordinates as doubles
      • getLatitude

        public double getLatitude()
        Return the latitude of this point.
        Returns:
        the Point's latitude
      • getLongitude

        public double getLongitude()
        Return the longitude of this point.
        Returns:
        the Point's longitude
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • convert

        public com.mongodb.client.model.geojson.Point convert()
        Description copied from interface: Geometry
        Converts this type to the driver type
        Specified by:
        convert in interface Geometry
        Returns:
        this Point converted to a driver Point
        Developer note. This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • convert

        public com.mongodb.client.model.geojson.Point convert​(CoordinateReferenceSystem crs)
        Description copied from interface: Geometry
        Converts this type to the driver type
        Specified by:
        convert in interface Geometry
        Parameters:
        crs - the CRS to use
        Returns:
        this Point converted to a driver Point
        Developer note. This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.