ArcGIS Pro 3.1 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.

In This Topic
    ReplaceSpatialReference Method
    In This Topic
    Replaces SpatialReference of the input Geometry instance.
    Syntax
    public static Geometry ReplaceSpatialReference( 
       Geometry sourceGeometry,
       SpatialReference newSpatialReference
    )
    Public Shared Function ReplaceSpatialReference( _
       ByVal sourceGeometry As Geometry, _
       ByVal newSpatialReference As SpatialReference _
    ) As Geometry

    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.0 or higher.
    See Also