ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryBagBuilderEx Class / FromJson Method
JSON string representation of GeometryBag.
Example

In This Topic
    FromJson Method (GeometryBagBuilderEx)
    In This Topic
    Creates a new instance of a GeometryBag class from a JSON string representation.
    Syntax
    public static GeometryBag FromJson( 
       string jsonString
    )
    Public Shared Function FromJson( _
       ByVal jsonString As String _
    ) As GeometryBag

    Parameters

    jsonString
    JSON string representation of GeometryBag.

    Return Value

    Exceptions
    ExceptionDescription
    The jsonString is empty or null.
    JSON string is invalid or does not represent a GeometryBag string.
    Example
    Construct GeometryBag - from JSON, Xml
    const string jsonString = "{\"geometries\":[{\"x\":1,\"y\":2},{\"rings\":[[[0,0],[0,4],[3,4],[3,0],[0,0]]]}],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}";
    //At 2.x - GeometryBag geometryBag = GeometryBagBuilder.FromJson(jsonString);
    var geometryBag = GeometryBagBuilderEx.FromJson(jsonString);
    
    string xml = geometryBag.ToXml();
    //At 2.x - GeometryBag xmlString = GeometryBagBuilder.FromXML(xml);
    var xmlString = GeometryBagBuilderEx.FromXml(xml);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also