Extrapolate a point beyond pole with GeometryEngine

337
2
Jump to solution
12-02-2022 07:32 AM
Tone
by
New Contributor II

Hi,

I'm currently developping an application using the 100.14.0 version of the SDK.

I should mention I'm not very experienced in manipulating projections so that might be the issue here.

There is something I can't figure out about the GeometryEngine, here is a sample code :

Point point = new Point(70, 0, SpatialReferences.getWgs84());

GeometryEngine.moveGeodetic(point, 8640000.0, new LinearUnit(LinearUnitId.METERS), 0.0, new AngularUnit(AngularUnitId.RADIANS), GeodeticCurveType.LOXODROME); //This returns Point: [0,000000, 90,000000, 0,000000, NaN] SR: 4326

 

I would expect the point to go beyond the north pole and circle around the earth, but it seems like the GeometryEngine cannot go beyond the pole in this configuration.

I suspect this has something to do with the projection, but I'm not knowledgeable enough about it to understand how to fix this.

Could anyone explain what's going on ? Are there any ressources I could read about this topic that could help me ?

0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor

I can see the problem here.  Loxodromes are lines which happen when you follow a compass bearing.  In your example you have a heading of 0 which is North.  If you are walking to the North Pole following a compass bearing of North (0), as soon as you reach magnetic north and keep going in the same direction your compass actually starts reading South!  This explains why no matter how big a number you pop into your move method, the loxodrome stops at the top of the earth.

Using your code, I switched the line type to a Geodesic (shortest distance between 2 points over the surface of the Earth) and the new point appeared having travelled over the pole.

This is my code:

      var graphicsOverlay = new GraphicsOverlay();
      mapView.getGraphicsOverlays().add(graphicsOverlay);

      // some markers
      SimpleMarkerSymbol redDot = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, Color.RED, 10);
      SimpleMarkerSymbol greenDot = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, Color.GREEN, 10);

      // original point
      Point point = new Point(70, 0, SpatialReferences.getWgs84());
      Graphic pointGraphic = new Graphic(point, redDot);
      graphicsOverlay.getGraphics().add(pointGraphic);

      //Point point2 = GeometryEngine.moveGeodetic(point, 8640000.0, new LinearUnit(LinearUnitId.METERS), 0.0, new AngularUnit(AngularUnitId.RADIANS), GeodeticCurveType.LOXODROME); //This returns Point: [0,000000, 90,000000, 0,000000, NaN] SR: 4326

      // geodesic move using a geodesic line instead of a loxodrome.
      Point point2 = GeometryEngine.moveGeodetic(point, 12075000, new LinearUnit(LinearUnitId.METERS), 0.0, new AngularUnit(AngularUnitId.RADIANS), GeodeticCurveType.GEODESIC);
      
      System.out.println("point 2= " + point2.toString());
      Graphic pointGraphic2 = new Graphic(point2, greenDot);
      graphicsOverlay.getGraphics().add(pointGraphic2);

 You can see the green dot in my app which went over the pole.

MarkBaird_0-1670004429304.png

 

I went a little further and increased the number to 40075000 which is roughly the circumference of the earth and the 2 dots where "fairly" close to each other.  Therefore the point went over the North Pole, the South Pole before coming back to where it started.

Does this help?

Mark 

View solution in original post

0 Kudos
2 Replies
MarkBaird
Esri Regular Contributor

I can see the problem here.  Loxodromes are lines which happen when you follow a compass bearing.  In your example you have a heading of 0 which is North.  If you are walking to the North Pole following a compass bearing of North (0), as soon as you reach magnetic north and keep going in the same direction your compass actually starts reading South!  This explains why no matter how big a number you pop into your move method, the loxodrome stops at the top of the earth.

Using your code, I switched the line type to a Geodesic (shortest distance between 2 points over the surface of the Earth) and the new point appeared having travelled over the pole.

This is my code:

      var graphicsOverlay = new GraphicsOverlay();
      mapView.getGraphicsOverlays().add(graphicsOverlay);

      // some markers
      SimpleMarkerSymbol redDot = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, Color.RED, 10);
      SimpleMarkerSymbol greenDot = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, Color.GREEN, 10);

      // original point
      Point point = new Point(70, 0, SpatialReferences.getWgs84());
      Graphic pointGraphic = new Graphic(point, redDot);
      graphicsOverlay.getGraphics().add(pointGraphic);

      //Point point2 = GeometryEngine.moveGeodetic(point, 8640000.0, new LinearUnit(LinearUnitId.METERS), 0.0, new AngularUnit(AngularUnitId.RADIANS), GeodeticCurveType.LOXODROME); //This returns Point: [0,000000, 90,000000, 0,000000, NaN] SR: 4326

      // geodesic move using a geodesic line instead of a loxodrome.
      Point point2 = GeometryEngine.moveGeodetic(point, 12075000, new LinearUnit(LinearUnitId.METERS), 0.0, new AngularUnit(AngularUnitId.RADIANS), GeodeticCurveType.GEODESIC);
      
      System.out.println("point 2= " + point2.toString());
      Graphic pointGraphic2 = new Graphic(point2, greenDot);
      graphicsOverlay.getGraphics().add(pointGraphic2);

 You can see the green dot in my app which went over the pole.

MarkBaird_0-1670004429304.png

 

I went a little further and increased the number to 40075000 which is roughly the circumference of the earth and the 2 dots where "fairly" close to each other.  Therefore the point went over the North Pole, the South Pole before coming back to where it started.

Does this help?

Mark 

0 Kudos
Tone
by
New Contributor II

Yes, thank you very much !

0 Kudos