laptop and a wrench

Bogue

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
Numéro d’ID de bogue BUG-000176904
EnvoiJune 3, 2025
Dernière modificationJune 20, 2025
S’applique àArcGIS Pro SDK for .NET
Version trouvée3.5
Système d’exploitationWindows OS
Version du système d’exploitation11.0 64 bit
StatutAs Designed

Informations supplémentaires

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

Étapes pour reproduire

ID de bogue: BUG-000176904

Logiciel:

  • ArcGIS Pro SDK for .NET

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement