Class Spheroid

java.lang.Object
org.apache.sedona.common.sphere.Spheroid

public class Spheroid extends Object
  • Field Details

  • Constructor Details

    • Spheroid

      public Spheroid()
  • Method Details

    • distance

      public static double distance(org.locationtech.jts.geom.Geometry geom1, org.locationtech.jts.geom.Geometry geom2)
      Calculate the distance between two points on the earth using the Spheroid formula. This algorithm does not use the radius of the earth, but instead uses the WGS84 ellipsoid. This is similar to the Vincenty algorithm,but use the algorithm in C. F. F. Karney, Algorithms for geodesics, J. Geodesy 87(1), 43–55 (2013) It uses the implementation from GeographicLib so please expect a small difference This will produce almost identical result to PostGIS ST_DistanceSpheroid and PostGIS ST_Distance(useSpheroid=true)
      Parameters:
      geom1 -
      geom2 -
      Returns:
    • length

      public static double length(org.locationtech.jts.geom.Geometry geometry)
      Calculates length just for linear geometries or geometry collection containing linear geometries.
      Parameters:
      geometry -
      Returns:
    • baseLength

      public static double baseLength(org.locationtech.jts.geom.Geometry geom)
      Base function to calculate the spheroid length/perimeter

      Calculate the length of a geometry using the Spheroid formula. Equivalent to PostGIS ST_LengthSpheroid and PostGIS ST_Length(useSpheroid=true) WGS84 ellipsoid is used.

      Parameters:
      geom -
      Returns:
    • area

      public static double area(org.locationtech.jts.geom.Geometry geom)
      Calculate the area of a geometry using the Spheroid formula. Equivalent to PostGIS ST_Area(useSpheroid=true) WGS84 ellipsoid is used.
      Parameters:
      geom -
      Returns:
    • angularWidth

      public static Double angularWidth(org.locationtech.jts.geom.Envelope envelope)
    • angularHeight

      public static Double angularHeight(org.locationtech.jts.geom.Envelope envelope)