ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Core.Geometry Namespace / MapPointBuilderEx Class / FromXml Method
XML string representation of a MapPoint.
Example

In This Topic
    FromXml Method (MapPointBuilderEx)
    In This Topic
    Creates a MapPoint from an XML string representation.
    Syntax
    public static MapPoint FromXml( 
       string xmlString
    )
    Public Shared Function FromXml( _
       ByVal xmlString As String _
    ) As MapPoint

    Parameters

    xmlString
    XML string representation of a MapPoint.

    Return Value

    Exceptions
    ExceptionDescription
    The xmlString is empty or null.
    XML is invalid or does not represent a MapPoint string.
    Example
    Import and Export Geometries to XML
    MapPoint minPoint = MapPointBuilderEx.CreateMapPoint(1, 1, 1, 1, 3);
    MapPoint maxPoint = MapPointBuilderEx.CreateMapPoint(5, 5, 5);
    
    // 
    //  MapPoint
    // 
    string xml = minPoint.ToXml();
    MapPoint minPointImport = MapPointBuilderEx.FromXml(xml);
    // minPointImport = minPoint
    
    //
    // Envelope
    //
    Envelope envelopeWithID = EnvelopeBuilderEx.CreateEnvelope(minPoint, maxPoint);
    
    // Envelopes don't have IDs
    // envelopeWithID.HasID = false
    // envelopeWithID.HasM = true
    // envelopeWithID.HasZ = true
    
    xml = envelopeWithID.ToXml();
    Envelope envelopeImport = EnvelopeBuilderEx.FromXml(xml);
    
    //
    // Multipoint
    //
    List<MapPoint> list = new List<MapPoint>();
    list.Add(minPoint);
    list.Add(maxPoint);
    
    Multipoint multiPoint = MultipointBuilderEx.CreateMultipoint(list);
    
    xml = multiPoint.ToXml();
    Multipoint multipointImport = MultipointBuilderEx.FromXml(xml);
    // multipointImport.PointCount == 2
    // multipointImport.HasID = true
    // multipointImport.HasM = true
    // multipointImport.HasZ= true
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also