ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / Project Method
The geometry to be projected. If the input geometry is empty, then an empty geometry with the output spatial reference is returned.
The spatial reference to which the geometry will be projected.
Example

In This Topic
    Project Method (IGeometryEngine)
    In This Topic
    Projects the given geometry to a new spatial reference. Same as GeometryEngine.ProjectEx(geometry, ProjectionTransformation.Create(geometry.SpatialReference, outputSpatialReference)); or, if both spatial references have vertical coordinate systems same as GeometryEngine.ProjectEx(geometry, ProjectionTransformation.CreateWithVertical(geometry.SpatialReference, outputSpatialReference));
    Syntax

    Parameters

    geometry
    The geometry to be projected. If the input geometry is empty, then an empty geometry with the output spatial reference is returned.
    outputSpatialReference
    The spatial reference to which the geometry will be projected.

    Return Value

    The projected geometry.
    Exceptions
    ExceptionDescription
    Geometry is null.
    The method is not implemented for GeometryBag.
    geometry.SpatialReference or output spatial reference is null.
    geometry.SpatialReference or output spatial reference is unknown coordinate system.
    Example
    Project from WGS84 to WebMercator
    MapPoint pt = MapPointBuilderEx.CreateMapPoint(1.0, 3.0, SpatialReferences.WGS84);
    Geometry result = GeometryEngine.Instance.Project(pt, SpatialReferences.WebMercator);
    MapPoint projectedPt = result as MapPoint;
    Project from WGS84
    // create the polygon
    List<MapPoint> pts = new List<MapPoint>();
    pts.Add(MapPointBuilderEx.CreateMapPoint(1.0, 1.0, SpatialReferences.WGS84));
    pts.Add(MapPointBuilderEx.CreateMapPoint(1.0, 2.0, SpatialReferences.WGS84));
    pts.Add(MapPointBuilderEx.CreateMapPoint(2.0, 2.0, SpatialReferences.WGS84));
    pts.Add(MapPointBuilderEx.CreateMapPoint(2.0, 1.0, SpatialReferences.WGS84));
    
    Polygon polygon = PolygonBuilderEx.CreatePolygon(pts);
    // ensure it is simple
    bool isSimple = GeometryEngine.Instance.IsSimpleAsFeature(polygon);
    
    // create the spatial reference to project to
    SpatialReference northPole = SpatialReferenceBuilder.CreateSpatialReference(102018);   // north pole stereographic 
    
    // project
    Geometry geometry = GeometryEngine.Instance.Project(polygon, northPole);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also