Select to view content in your preferred language

How to construct Geodesic Great Circle ?

4227
3
Jump to solution
02-13-2013 06:20 AM
JeremieJoalland1
Occasional Contributor II
I was able to construct Geodetic Great Circle polyline in a previous application developed with ArcGIS Engine Dev. Kit 10.0 for DotNet (and C#), using IConstructGeodetic:ConstructGeodeticLineFromDistance.

I'm now working with ArcGIS Runtime 10.1.1 for Java (Windows) and I'm new at it...
I would like to do the exact same thing, but as there's no ArcObjects SDK, how can I do it ?
is there any way to do it through ArcPy ? programmatically ?

Here's my sample code from ArcGIS Engine, it draw 2000 geodetic polylines :
this.myGraphicTracker.SuspendUpdate = true;  // Add 2000 geometries (geodesic great circle) to a Graphic Tracker IPolyline polyligneGeodesic; IGeometry geometry; IPoint pointOrigin; double coordX = 99166; double coordY = 538333; double polylineDistanceKm = 400; double azimut = 1;  // Point of origin pointOrigin = new PointClass(); pointOrigin.PutCoords(coordX, coordY);  for (int i = 0; i < 2000; i++) {     azimut = azimut + 1.1;      // Construct the Polyline     polyligneGeodesic = CartoEngine.ConstructGeodeticGreatCircleLine(pointOrigin, azimut, polylineDistanceKm);     geometry = polyligneGeodesic as IGeometry;      CartoEngine.ProjeterWGS84VersRefSpatialeCarte(geometry, this.axMapControl.Map.SpatialReference);      // Add the Geometry to the Graphic Tracker     this.myGraphicTracker.Add(geometry, this.myLineSymbol);      // Preserve references to COM objects IGeometry     this.listOfMyGeometries.Add(geometry); }  this.myGraphicTracker.SuspendUpdate = false;


where the method which use IConstructGeodetic:ConstructGeodeticLineFromDistance is :

public static class CartoEngine {     public static IPolyline ConstructGeodeticGreatCircleLine(IPoint pointOrigin, double azimut, double distanceKm)     {         IPolyline polyline = new PolylineClass();          try         {             IConstructGeodetic CG = polyline as IConstructGeodetic;              if (CG != null)             {                 // Instanciation of input Spatial Reference                 ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass();                 ISpatialReference spatialReference = spatialReferenceFactory.CreateSpatialReference((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);                  // Linear Unit                  ILinearUnit uniteLineaire = spatialReferenceFactory.CreateUnit((int)esriSRUnitType.esriSRUnit_Kilometer) as ILinearUnit;                  if (uniteLineaire != null)                 {                     pointOrigin.SpatialReference = spatialReference;                     double parametreDensifier = 1;                     esriCurveDensifyMethod methodeDensifier = esriCurveDensifyMethod.esriCurveDensifyByDeviation;                     esriGeodeticType typeGeodesique = esriGeodeticType.esriGeodeticTypeGreatElliptic;                      // Construct the polyline "great circle"                     CG.ConstructGeodeticLineFromDistance(typeGeodesique, pointOrigin, uniteLineaire, distanceKm, azimut, methodeDensifier, parametreDensifier);                 }                 else                 { polyline = null; }             }             else             { polyline = null; }         }         catch (COMException exc)         {             polyline = null;         }         catch (Exception exc)         {             polyline = null;         }                      return polyline;     } }
0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor
Hi Jeremie,

At the moment the Runtime API does not have the ability to create geodesic geometries, but this is something we are considering for the next release due layer this year.

This may include items like: creating geodesic lines, polygons and elipses and also the ability to calculate geodesic buffers and offsets.

We are always looking to improve the API so please let me know if you have any other requirements which we can consider.

Regards

Mark

View solution in original post

0 Kudos
3 Replies
MarkBaird
Esri Regular Contributor
Hi Jeremie,

At the moment the Runtime API does not have the ability to create geodesic geometries, but this is something we are considering for the next release due layer this year.

This may include items like: creating geodesic lines, polygons and elipses and also the ability to calculate geodesic buffers and offsets.

We are always looking to improve the API so please let me know if you have any other requirements which we can consider.

Regards

Mark
0 Kudos
MarkBaird
Esri Regular Contributor
Been thinking some more about this to see if there is a workaround in the short term.  You could consider:

- If your application has online access, then you could use an ArcGIS Server (or online) geometry service.  There is a Rest spec for this if you are interested.

- You could write a geodescic densify function yourself if you are good at geometry maths.

- Lastly (I was talking to a friend in the WPF Runtime team), I'm afraid to say that the WPF Runtime API already has this functionality.  Mostly the runtime APIs are quite closely aligned in terms of functionality, but they can do it now:

http://resources.arcgis.com/en/help/runtime-wpf/samples/index.html#/Geodesic/02q20000009v000000/

Hope that helps

Mark
0 Kudos
JeremieJoalland1
Occasional Contributor II
Thanks for your reply.

unfortunately our development environment is in Java and we are stuck in disconnected scenario...

Is it not possible to create a Local Geoprocessing Package with ArcGIS Desktop (from Model Builder / ArcPy ?), and then use it with ArcGIS Runtime SDK for Java, as it is done for Buffer in the ESRI samples ?

in my case, is there any Tool from Toolbox which does the same thing that "Construct Geodetic" tool from the "Advanced Editing" toolbar ?

(sorry for these basic questions, but i'm still new at Geoprocessing Packages)

regards,
0 Kudos