laptop and a wrench

Error

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
Número de ID del error BUG-000176904
EnviadoJune 3, 2025
Última modificaciónJune 20, 2025
Relacionado conArcGIS Pro SDK for .NET
Versión encontrada3.5
Sistema operativoWindows OS
Versión de sistema operativo11.0 64 bit
EstadoAs Designed

Información adicional

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

Pasos para reproducir

ID del error: BUG-000176904

Software:

  • ArcGIS Pro SDK for .NET

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga