ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / LabelPoint Method
The polygon or envelope to label.
Example

In This Topic
    LabelPoint Method (GeometryEngine)
    In This Topic
    Performs the LabelPoint operation on the geometry.
    Syntax
    public MapPoint LabelPoint( 
       Geometry geometry
    )
    Public Function LabelPoint( _
       ByVal geometry As Geometry _
    ) As MapPoint

    Parameters

    geometry
    The polygon or envelope to label.

    Return Value

    Returns the label point for the geometry.
    Exceptions
    ExceptionDescription
    Geometry is null or empty.
    The method is not implemented for GeometryBag.
    Geometry is not a polygon or an envelope.
    Example
    Determine label point for a Polygon
    // create a polygon
    List<Coordinate2D> list2D = new List<Coordinate2D>();
    list2D.Add(new Coordinate2D(1.0, 1.0));
    list2D.Add(new Coordinate2D(1.0, 2.0));
    list2D.Add(new Coordinate2D(2.0, 2.0));
    list2D.Add(new Coordinate2D(2.0, 1.0));
    
    Polygon polygon = PolygonBuilderEx.CreatePolygon(list2D);
    bool isSimple = GeometryEngine.Instance.IsSimpleAsFeature(polygon);
    MapPoint pt = GeometryEngine.Instance.LabelPoint(polygon);
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also