Package org.apache.sedona.common.sphere
Class Spheroid
java.lang.Object
org.apache.sedona.common.sphere.Spheroid
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleangularHeight(org.locationtech.jts.geom.Envelope envelope) static DoubleangularWidth(org.locationtech.jts.geom.Envelope envelope) static doublearea(org.locationtech.jts.geom.Geometry geom) Calculate the area of a geometry using the Spheroid formula.static doublebaseLength(org.locationtech.jts.geom.Geometry geom) Base function to calculate the spheroid length/perimeterstatic doubledistance(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.static doublelength(org.locationtech.jts.geom.Geometry geometry) Calculates length just for linear geometries or geometry collection containing linear geometries.
-
Field Details
-
EPSG_WORLD_MERCATOR
public static final int EPSG_WORLD_MERCATOR- See Also:
-
EPSG_NORTH_UTM_START
public static final int EPSG_NORTH_UTM_START- See Also:
-
EPSG_NORTH_UTM_END
public static final int EPSG_NORTH_UTM_END- See Also:
-
EPSG_NORTH_LAMBERT
public static final int EPSG_NORTH_LAMBERT- See Also:
-
EPSG_NORTH_STEREO
public static final int EPSG_NORTH_STEREO- See Also:
-
EPSG_SOUTH_UTM_START
public static final int EPSG_SOUTH_UTM_START- See Also:
-
EPSG_SOUTH_UTM_END
public static final int EPSG_SOUTH_UTM_END- See Also:
-
EPSG_SOUTH_LAMBERT
public static final int EPSG_SOUTH_LAMBERT- See Also:
-
EPSG_SOUTH_STEREO
public static final int EPSG_SOUTH_STEREO- See Also:
-
-
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/perimeterCalculate 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
-
angularHeight
-