Class Wgs84Projection

java.lang.Object
org.eclipse.mosaic.lib.transform.GeoProjection
org.eclipse.mosaic.lib.transform.Wgs84Projection

public class Wgs84Projection extends GeoProjection
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 Details

  • Constructor Details

    • Wgs84Projection

      public Wgs84Projection(GeoPoint origin)
      Initializes the projection based on the GeoPoint which is used as the playground center when converting to local coordinates.
      Parameters:
      origin - the playground center
    • Wgs84Projection

      public Wgs84Projection(UtmPoint origin)
      Initializes the projection based on the UtmPoint which is used as the playground center when converting to local coordinates.
      Parameters:
      origin - the playground center
    • Wgs84Projection

      @Deprecated public Wgs84Projection(GeoPoint playgroundCenter, CartesianPoint cartesianOffset)
      Deprecated.
      Legacy constructor.
      This is a legacy constructor, still used internally.
  • Method Details

    • failIfOutsideWorld

      public Wgs84Projection failIfOutsideWorld()
      Enables the option to fail if the conversion from UTM leads to a coordinate outside of the world.
      Returns:
      this projection
    • useZoneOfUtmOrigin

      public Wgs84Projection useZoneOfUtmOrigin()
      Enables the option to use the zone of the UTM origin point when converting to UTM Point.
      Returns:
      this projection
    • geographicToVector

      public Vector3d geographicToVector(GeoPoint geographic, Vector3d result)
      Description copied from class: GeoProjection
      Converts a geographic WGS84 coordinate depicted by a GeoPoint into local coordinates coordinates.
      Specified by:
      geographicToVector in class GeoProjection
      Parameters:
      geographic - geographic WGS84 coordinates
      result - the MutableUtmPoint to which the result is written to
      Returns:
      the result object with converted local coordinates
    • vectorToGeographic

      public MutableGeoPoint vectorToGeographic(Vector3d vector3d, MutableGeoPoint result)
      Description copied from class: GeoProjection
      Converts a local coordinate depicted by a Vector3d to geographic WGS84 coordinates.
      Specified by:
      vectorToGeographic in class GeoProjection
      Parameters:
      vector3d - the local coordinate
      result - the MutableGeoPoint 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 a GeoPoint into local coordinates coordinates.
      Specified by:
      geographicToCartesian in class GeoProjection
      Parameters:
      geographic - geographic WGS84 coordinates
      result - the MutableUtmPoint to which the result is written to
      Returns:
      the result object with converted local coordinates
    • cartesianToGeographic

      public MutableGeoPoint cartesianToGeographic(CartesianPoint cartesian, MutableGeoPoint result)
      Description copied from class: GeoProjection
      Converts a local coordinate depicted by a CartesianPoint to geographic WGS84 coordinates.
      Specified by:
      cartesianToGeographic in class GeoProjection
      Parameters:
      cartesian - the local coordinate
      result - the MutableGeoPoint to which the result is written to
      Returns:
      the result object with converted WGS84 coordinates
    • utmToVector

      public Vector3d utmToVector(UtmPoint utm, Vector3d result)
      Description copied from class: GeoProjection
      Converts a cartesian world coordinate depicted by a UtmPoint into local coordinates coordinates.
      Specified by:
      utmToVector in class GeoProjection
      Parameters:
      utm - the cartesian world UTM coordinate.
      result - the MutableUtmPoint to which the result is written to
      Returns:
      the result object with converted local coordinates
    • vectorToUtm

      public MutableUtmPoint vectorToUtm(Vector3d vector, MutableUtmPoint result)
      Description copied from class: GeoProjection
      Converts a local coordinate depicted by a Vector3d into UTM coordinates.
      Specified by:
      vectorToUtm in class GeoProjection
      Parameters:
      vector - the local coordinate
      result - the MutableUtmPoint to which the result is written to
      Returns:
      the result object with converted UTM coordinates
    • geographicToUtm

      public MutableUtmPoint geographicToUtm(GeoPoint geoPoint, MutableUtmPoint result)
      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 class GeoProjection
      Parameters:
      geoPoint - geographic WGS84 coordinates
      result - the MutableUtmPoint to which the result is written to
      Returns:
      the result object with converted UTM coordinates
    • utmToGeographic

      public MutableGeoPoint utmToGeographic(UtmPoint utmPoint, MutableGeoPoint result)
      Description copied from class: GeoProjection
      Converts a cartesian world coordinate depicted by a UtmPoint to geographic WGS84 coordinates.
      Specified by:
      utmToGeographic in class GeoProjection
      Parameters:
      utmPoint - cartesian UTM coordinates
      result - the MutableGeoPoint to which the result is written to
      Returns:
      the result object with converted WGS84 coordinates