Package org.hortonmachine.gears.utils
Class ENU
- java.lang.Object
-
- org.hortonmachine.gears.utils.ENU
-
public class ENU extends Object
Conversion of Geodetic coordinates to the Local Tangent Plane.Class that supports WGS84 to East-North-Up conversion. The conversions reference the base coordinate that is given at construction time.
Math is available in the paper: Conversion of Geodetic coordinates to the Local Tangent Plane.
The ecefToWgs84 method adapted from the goGPS project.
Note that all coordinates need to have a Z available. If the Z is NaN, then it is set to 0.
- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description ENU(org.locationtech.jts.geom.Coordinate baseCoordinateLL)Create a new East North Up system.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.EnvelopeconvertEnvelopeFromWgsToEnu(org.locationtech.jts.geom.Envelope envelopeWgs)Converts an envelope from WGS to ENU.voidconvertGeometryFromEnuToWgs84(org.locationtech.jts.geom.Geometry geometryEnu)Converts a geometry from ENU to WGS.voidconvertGeometryFromWgsToEnu(org.locationtech.jts.geom.Geometry geometryWgs)Converts a geometry from WGS to ENU.org.locationtech.jts.geom.CoordinateecefToEnu(org.locationtech.jts.geom.Coordinate cEcef)Converts an Earth-Centered Earth-Fixed (ECEF) coordinate to ENU.org.locationtech.jts.geom.CoordinateecefToWgs84(org.locationtech.jts.geom.Coordinate ecef)Converts a Earth-Centered Earth-Fixed (ECEF) coordinate to WGS84.org.locationtech.jts.geom.CoordinateenuToEcef(org.locationtech.jts.geom.Coordinate cEnu)Converts an ENU coordinate to Earth-Centered Earth-Fixed (ECEF).org.locationtech.jts.geom.CoordinateenuToWgs84(org.locationtech.jts.geom.Coordinate enu)Converts the ENU coordinate to wgs84.org.locationtech.jts.geom.Coordinatewgs84ToEcef(org.locationtech.jts.geom.Coordinate cLL)Converts WGS84 coordinates to Earth-Centered Earth-Fixed (ECEF) coordinates.org.locationtech.jts.geom.Coordinatewgs84ToEnu(org.locationtech.jts.geom.Coordinate cLL)Converts the wgs84 coordinate to ENU.
-
-
-
Method Detail
-
wgs84ToEnu
public org.locationtech.jts.geom.Coordinate wgs84ToEnu(org.locationtech.jts.geom.Coordinate cLL)
Converts the wgs84 coordinate to ENU.- Parameters:
cLL- the wgs84 coordinate.- Returns:
- the ENU coordinate.
- Throws:
MatrixException
-
enuToWgs84
public org.locationtech.jts.geom.Coordinate enuToWgs84(org.locationtech.jts.geom.Coordinate enu)
Converts the ENU coordinate to wgs84.- Parameters:
enu- the ENU coordinate.- Returns:
- the wgs84 coordinate.
- Throws:
MatrixException
-
wgs84ToEcef
public org.locationtech.jts.geom.Coordinate wgs84ToEcef(org.locationtech.jts.geom.Coordinate cLL)
Converts WGS84 coordinates to Earth-Centered Earth-Fixed (ECEF) coordinates.- Parameters:
cLL- the wgs84 coordinate.- Returns:
- the ecef coordinate.
-
ecefToEnu
public org.locationtech.jts.geom.Coordinate ecefToEnu(org.locationtech.jts.geom.Coordinate cEcef)
Converts an Earth-Centered Earth-Fixed (ECEF) coordinate to ENU.- Parameters:
cEcef- the ECEF coordinate.- Returns:
- the ENU coordinate.
- Throws:
MatrixException
-
enuToEcef
public org.locationtech.jts.geom.Coordinate enuToEcef(org.locationtech.jts.geom.Coordinate cEnu)
Converts an ENU coordinate to Earth-Centered Earth-Fixed (ECEF).- Parameters:
cEnu- the enu coordinate.- Returns:
- the ecef coordinate.
-
ecefToWgs84
public org.locationtech.jts.geom.Coordinate ecefToWgs84(org.locationtech.jts.geom.Coordinate ecef)
Converts a Earth-Centered Earth-Fixed (ECEF) coordinate to WGS84.- Parameters:
ecef- the ecef coordinate.- Returns:
- the wgs84 coordinate.
-
convertGeometryFromEnuToWgs84
public void convertGeometryFromEnuToWgs84(org.locationtech.jts.geom.Geometry geometryEnu)
Converts a geometry from ENU to WGS.Note that the geometry is internally converted. Use clone() if you need a copy.
- Parameters:
geometryEnu-
-
convertGeometryFromWgsToEnu
public void convertGeometryFromWgsToEnu(org.locationtech.jts.geom.Geometry geometryWgs)
Converts a geometry from WGS to ENU.Note that the geometry is internally converted. Use clone() if you need a copy.
- Parameters:
geometryWgs-
-
convertEnvelopeFromWgsToEnu
public org.locationtech.jts.geom.Envelope convertEnvelopeFromWgsToEnu(org.locationtech.jts.geom.Envelope envelopeWgs)
Converts an envelope from WGS to ENU.- Parameters:
envelopeWgs-- Returns:
- the converted envelope.
-
-