AnsweredAssumed Answered

[ArcEngine] Drawing projected geometry

Question asked by Adjutant on Apr 30, 2012
Latest reply on Jul 18, 2012 by Adjutant

The documentation for the IGemetry.Project method : shows how an object can be projected into another coordinate space.

Assuming that I am working with WGS84 referenced maps, I then want to draw a geometry (circle).
In the case of WGS84, drawing a 'circle' (with constant radius), will actually be visualized (projected) as an ellipsoid - see attached image.

My problem is that the following projection does not seem to be working :
          PointClass centroid = new PointClass() { X = 0, Y = 0};           PointClass permiterPoint = new PointClass() { X = 4, Y = 0 };           CircularArcClass circularArc = new CircularArcClass();           circularArc.PutCoords(centroid, permiterPoint, permiterPoint, esriArcOrientation.esriArcClockwise);            IPolygon polygon = new PolygonClass();           segmentCollection = polygon as ISegmentCollection;           segmentCollection.AddSegment(circularArc);            ISpatialReferenceFactory srFactory = new SpatialReferenceEnvironmentClass();           IGeographicCoordinateSystem cs1 = srFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_Clarke1880);           IGeographicCoordinateSystem cs2 = srFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);           polygon.SpatialReference = cs1;            polygon.Project(cs2);            IGraphicTrackerSymbol graphicTrackerSymbol = graphicTracker.CreateSymbol(fillSymbol as ISymbol, null);           int graphicID = graphicTracker.Add(polygon, graphicTrackerSymbol);

(I have not added any maps yet, and have not set the any layer spacial relations).

The 'inner' circle is the result of the code above.
The 'outer' (shaded) ellipsoid is the result of another filled polygon (not in the code above) which is constructed by manually calculating the perimeter coordinates.

The source coordinate system is obviously not Clarke 1880, I just set it to Clarke to try and get a response out of the Project method.
What am I doing wrong in terms of the projection - why is the polygon not being projected into the ellipsical coordinates that are used to represent WGS 84?