ArcGIS Pro 3.7 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 Shared Function ReplaceSpatialReference( _
       ByVal sourceGeometry As Geometry, _
       ByVal newSpatialReference As SpatialReference _
    ) As Geometry
    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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also