laptop and a wrench

Bug

In ArcGIS Pro SDK for .NET, when using the SimplifyAsFeature method (GeometryEngine), the length of the feature returns null values.

ArcGIS Pro SDK for .NET
Bug ID Number BUG-000176904
SubmittedJune 3, 2025
Last ModifiedJune 20, 2025
Applies toArcGIS Pro SDK for .NET
Version found3.5
Operating SystemWindows OS
Operating System Version11.0 64 bit
StatusAs Designed

Additional Information

The CreatePolygon method inserts each polyline as a separate part; however, each polyline contains only two points. The resulting polygon has four parts, each of which degenerates to a line. When SimplifyAsFeature is called, the degenerate parts are removed, leaving an empty polygon. Instead of creating two-point polylines, create line segments and either call PolygonBuilderEx.AddSegment for each segment, or create the polygon by using PolygonBuilderEx.CreatePolygon. Here is an example. // Define input polyline edges (clockwise) Segment lnN = LineBuilderEx.CreateLineSegment(MapPointBuilderEx.CreateMapPoint(0, 10), MapPointBuilderEx.CreateMapPoint(10, 10)); Segment lnE = LineBuilderEx.CreateLineSegment(MapPointBuilderEx.CreateMapPoint(10, 10), MapPointBuilderEx.CreateMapPoint(10, 0)); Segment lnS = LineBuilderEx.CreateLineSegment(MapPointBuilderEx.CreateMapPoint(10, 0), MapPointBuilderEx.CreateMapPoint(0, 0)); Segment lnW = LineBuilderEx.CreateLineSegment(MapPointBuilderEx.CreateMapPoint(0, 0), MapPointBuilderEx.CreateMapPoint(0, 10)); Polygon plyNew = PolygonBuilderEx.CreatePolygon(new Segment[] { lnN, lnE, lnS, lnW }); double length = plyNew.Length; // length = 40 Polygon simplifiedPolygon = GeometryEngine.Instance.SimplifyAsFeature(plyNew) as Polygon; length = simplifiedPolygon.Length; // length = 40 bool isSimple = GeometryEngine.Instance.IsSimpleAsFeature(simplifiedPolygon); // isSimple = true

Steps to Reproduce

Bug ID: BUG-000176904

Software:

  • ArcGIS Pro SDK for .NET

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options