Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

UA ProjectionHelper



This article explains how the UA application ProjectionHelper works.

Overview


The UAAppliHelper.jar library contains a ProjectionHelper class allowing to:
  • get the bearing of the vector of two MapItems
  • get the East/North position of a MapItems knowing its Latitude/Longitude
  • get the Latitude/Longitude of a MapItems knowing its East/North position in nautical miles
  • get the Latitude/Longitude of a MapItems knowing its position in 100th of mm from the dreference of the Map or from a point

To use the ProjectionHelper class, you need to configure to reference of the Map, ie:
  • Its reference point
  • Its screen range and range in Nautical miles
  • Its orientation

Accessing the class

To be able to use the UAAppliHelper.jar library, you will need to reference it in your application configuration. For example:
      <applications>
         <application name="uaappli">
            <deployment>
               <lib url="UAApplication.jar" />
               <lib url="UAAppliHelper.jar" />
            </deployment>
            <modules>
               <module name="uaappli"/>     
            </modules>
         </application>     
      </applications>

Configure the ProjectionHelper

The following methods specify the reference of the Map:
projectionhelper
For example:
      ProjectionHelper helper = new ProjectionHelper();
      helper.setPRP(<latitude>, <longitude>);
      helper.setRange(40, 25000); // the range is 40 nautical miles corresponding to 25000 100th of MM

Get the bearing of the vector of two MapItems knowing their relative position in meters

The ProjectionHelper.getBearing(MapPosition) return the beating between two points on the map.

For example:
      MapPosition point1 = new MapPosition.Double(<latitude>, <longitude>);
      MapPosition point2 = new MapPosition.Double(<latitude>, <longitude>);  
      double bearing = ProjectionHelper.getBearing(point1, point2);

Get the bearing and distance between two MapItems

Get the bearing of the vector of two MapItems

The ProjectionHelper.getBearing(MapPosition) return the bearing between two points on the map, knowiong their positions in meters relative to the center of the map.

For example:
      MapPosition point1 = new MapPosition.Double(<eastNM>, <northNM>);
      MapPosition point2 = new MapPosition.Double(<eastNM>, <northNM>);  
      double bearing = ProjectionHelper.getBearing(point1, point2);
The ProjectionHelper.getBearingFromLatLong(MapPosition, MapPosition) return the bearing between two points on the map, knowing their positions in (latitude, longitude).

For example:
      MapPosition point1 = new MapPosition.Double(<latitude>, <longitude>);
      MapPosition point2 = new MapPosition.Double(<latitude>, <longitude>);  
      double bearing = ProjectionHelper.getBearing(point1, point2);

Get the distance between two MapItems

The ProjectionHelper.getDistanceTo(MapPosition, MapPosition) return the distance between two points on the map, knowing their positions in (latitude, longitude).

For example:
      MapPosition point1 = new MapPosition.Double(<latitude>, <longitude>);
      MapPosition point2 = new MapPosition.Double(<latitude>, <longitude>);  
      double bearing = ProjectionHelper.getDistanceTo(point1, point2);

Conversion to/from latitude/longitude and Nautical miles

Get the East/North position of a MapItem knowing its Latitude/Longitude position

The ProjectionHelper.getEastNorthPosition(MapPosition) return the (east, north) position of a point (in nautical miles) knowing its position in (latitude, longitude).

For example:
      MapPosition point = new MapPosition.Double(<latitude>, <longitude>);
      MapPosition pointNM = ProjectionHelper.getEastNorthPosition(point);

Get the Latitude/Longitude position of a MapItem knowing its East/North position

The ProjectionHelper.getLatLongPosition(MapPosition) return the (east, north) (latitude, longitude) position of a point from the center of the Map knowing its east/north position in nautical miles.

For example:
      MapPosition point = new MapPosition.Double(<eastNM>, <northNM>);
      MapPosition pointlatLong = ProjectionHelper.getLatLongPosition(point);
The ProjectionHelper.getLatLongPosition(MapPosition, MapPosition) return the (latitude, longitude) position of a point from a reference point, knowing its east/north position in nautical miles.

For example:
      MapPosition refpoint = new MapPosition.Double(<latitude>, <longitude>);
      MapPosition relativeNM = new MapPosition.Double(<eastNM>, <northNM>);
      MapPosition pointlatLong = ProjectionHelper.getLatLongPosition(refpoint, relativeNM);

Conversion from a position in 100th of mm

The ProjectionHelper.getLatLongPositionFromMM(MapPosition, MapPosition) return the (latitude, longitude) position of a point from a reference point, knowing its relative position in 100th of mm.

For example:
      MapPosition refpoint = new MapPosition.Double(<latitude>, <longitude>);
      MapPosition relativeMM = new MapPosition.Double(<x_mm>, <y_mm>);
      MapPosition pointlatLong = ProjectionHelper.getLatLongPosition(refpoint, relativeMM);
The ProjectionHelper.getLatLongPositionFromMM(MapPosition, double, double) return the (east, north) (latitude, longitude) position of a point from a reference point, knowing its distance in mm and its bearing relative to the reference point.

For example:
      MapPosition refpoint = new MapPosition.Double(<latitude>, <longitude>);
      MapPosition pointlatLong = ProjectionHelper.getLatLongPosition(refpoint, <distance_mm>, <bearing_mm>);

Taking care of the angle units

By default if not specified in the methods, angles are defined in Units.DEG360.

However, most of the methods in the helper have several versions allowing to specify which angle unit will be used. For example: Note that methods which need to provide an angle in DEG360 will take care of performing the modulo if necessary (for example if adding an angle of 300 ° with 90 °) You can also explicitly use the UnitsConverter class which with convert from your angle to DEG360. For example:
      double angle2 = angle + 90;
      angle2 = UnitsConverter.convert(angle2, Units.DEG, Units.DEG360);

See also


Categories: builtin-applis | uaappli

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence