ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryBuilderEx Class / ReplaceSpatialReference Method
The source geometry that needs a new spatial reference.
New spatial reference to set.
Version

    ReplaceSpatialReference Method
    Replaces SpatialReference of the input Geometry instance.
    Syntax
    public static Geometry ReplaceSpatialReference( 
       Geometry sourceGeometry,
       SpatialReference newSpatialReference
    )

    Parameters

    sourceGeometry
    The source geometry that needs a new spatial reference.
    newSpatialReference
    New spatial reference to set.

    Return Value

    Returns new Geometry instance if sourceGeometry.SpatialReference != newSpatialReference The method returns sourceGeometry if the newSpatialReference == sourceGeometry.SpatialReference.
    Exceptions
    ExceptionDescription
    The geometry is null.
    The geometry is the wrong type.
    Remarks
    The method only supports Geometry types that have corresponding GeometryBuilderEx implemented.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also