Package org.eclipse.mosaic.lib.transform
Class Wgs84Projection
java.lang.Object
org.eclipse.mosaic.lib.transform.GeoProjection
org.eclipse.mosaic.lib.transform.Wgs84Projection
Converts WGS84 based coordinates (lat,lon) to cartesian coordinates (x,y)
using a WGS84 to UTM conversion algorithm. The conversion is based on
the algorithm written by Chuck Gantz (chuck.gantz@globalstar.com).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWgs84Projection
(GeoPoint origin) Initializes the projection based on theGeoPoint
which is used as the playground center when converting to local coordinates.Wgs84Projection
(GeoPoint playgroundCenter, CartesianPoint cartesianOffset) Deprecated.Legacy constructor.Wgs84Projection
(UtmPoint origin) Initializes the projection based on theUtmPoint
which is used as the playground center when converting to local coordinates. -
Method Summary
Modifier and TypeMethodDescriptioncartesianToGeographic
(CartesianPoint cartesian, MutableGeoPoint result) Converts a local coordinate depicted by aCartesianPoint
to geographic WGS84 coordinates.Enables the option to fail if the conversion from UTM leads to a coordinate outside of the world.geographicToCartesian
(GeoPoint geographic, MutableCartesianPoint result) Converts a geographic WGS84 coordinate depicted by aGeoPoint
into local coordinates coordinates.geographicToUtm
(GeoPoint geoPoint, MutableUtmPoint result) Converts lat/long to UTM coords.geographicToVector
(GeoPoint geographic, Vector3d result) Converts a geographic WGS84 coordinate depicted by aGeoPoint
into local coordinates coordinates.Enables the option to use the zone of the UTM origin point when converting to UTM Point.utmToGeographic
(UtmPoint utmPoint, MutableGeoPoint result) Converts a cartesian world coordinate depicted by aUtmPoint
to geographic WGS84 coordinates.utmToVector
(UtmPoint utm, Vector3d result) Converts a cartesian world coordinate depicted by aUtmPoint
into local coordinates coordinates.vectorToGeographic
(Vector3d vector3d, MutableGeoPoint result) Converts a local coordinate depicted by aVector3d
to geographic WGS84 coordinates.vectorToUtm
(Vector3d vector, MutableUtmPoint result) Converts a local coordinate depicted by aVector3d
into UTM coordinates.Methods inherited from class org.eclipse.mosaic.lib.transform.GeoProjection
cartesianToGeographic, geographicToCartesian, geographicToUtm, geographicToVector, getGeoCalculator, getInstance, initialize, isInitialized, setGeoCalculator, utmToGeographic, utmToVector, vectorToGeographic, vectorToUtm
-
Field Details
-
K_0
public static final double K_0- See Also:
-
-
Constructor Details
-
Wgs84Projection
Initializes the projection based on theGeoPoint
which is used as the playground center when converting to local coordinates.- Parameters:
origin
- the playground center
-
Wgs84Projection
Initializes the projection based on theUtmPoint
which is used as the playground center when converting to local coordinates.- Parameters:
origin
- the playground center
-
Wgs84Projection
Deprecated.Legacy constructor.This is a legacy constructor, still used internally.
-
-
Method Details
-
failIfOutsideWorld
Enables the option to fail if the conversion from UTM leads to a coordinate outside of the world.- Returns:
- this projection
-
useZoneOfUtmOrigin
Enables the option to use the zone of the UTM origin point when converting to UTM Point.- Returns:
- this projection
-
geographicToVector
Description copied from class:GeoProjection
Converts a geographic WGS84 coordinate depicted by aGeoPoint
into local coordinates coordinates.- Specified by:
geographicToVector
in classGeoProjection
- Parameters:
geographic
- geographic WGS84 coordinatesresult
- theMutableUtmPoint
to which the result is written to- Returns:
- the result object with converted local coordinates
-
vectorToGeographic
Description copied from class:GeoProjection
Converts a local coordinate depicted by aVector3d
to geographic WGS84 coordinates.- Specified by:
vectorToGeographic
in classGeoProjection
- Parameters:
vector3d
- the local coordinateresult
- theMutableGeoPoint
to which the result is written to- Returns:
- the result object with converted WGS84 coordinates
-
geographicToCartesian
public MutableCartesianPoint geographicToCartesian(GeoPoint geographic, MutableCartesianPoint result) Description copied from class:GeoProjection
Converts a geographic WGS84 coordinate depicted by aGeoPoint
into local coordinates coordinates.- Specified by:
geographicToCartesian
in classGeoProjection
- Parameters:
geographic
- geographic WGS84 coordinatesresult
- theMutableUtmPoint
to which the result is written to- Returns:
- the result object with converted local coordinates
-
cartesianToGeographic
Description copied from class:GeoProjection
Converts a local coordinate depicted by aCartesianPoint
to geographic WGS84 coordinates.- Specified by:
cartesianToGeographic
in classGeoProjection
- Parameters:
cartesian
- the local coordinateresult
- theMutableGeoPoint
to which the result is written to- Returns:
- the result object with converted WGS84 coordinates
-
utmToVector
Description copied from class:GeoProjection
Converts a cartesian world coordinate depicted by aUtmPoint
into local coordinates coordinates.- Specified by:
utmToVector
in classGeoProjection
- Parameters:
utm
- the cartesian world UTM coordinate.result
- theMutableUtmPoint
to which the result is written to- Returns:
- the result object with converted local coordinates
-
vectorToUtm
Description copied from class:GeoProjection
Converts a local coordinate depicted by aVector3d
into UTM coordinates.- Specified by:
vectorToUtm
in classGeoProjection
- Parameters:
vector
- the local coordinateresult
- theMutableUtmPoint
to which the result is written to- Returns:
- the result object with converted UTM coordinates
-
geographicToUtm
Converts lat/long to UTM coords. Equations from USGS Bulletin 1532 East Longitudes are positive, West longitudes are negative. North latitudes are positive, South latitudes are negative Lat and Long are in decimal degrees Written by Chuck Gantz- chuck.gantz@globalstar.com- Specified by:
geographicToUtm
in classGeoProjection
- Parameters:
geoPoint
- geographic WGS84 coordinatesresult
- theMutableUtmPoint
to which the result is written to- Returns:
- the result object with converted UTM coordinates
-
utmToGeographic
Description copied from class:GeoProjection
Converts a cartesian world coordinate depicted by aUtmPoint
to geographic WGS84 coordinates.- Specified by:
utmToGeographic
in classGeoProjection
- Parameters:
utmPoint
- cartesian UTM coordinatesresult
- theMutableGeoPoint
to which the result is written to- Returns:
- the result object with converted WGS84 coordinates
-