laptop and a wrench

Erro

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 do Erro BUG-000176904
EnviadoJune 3, 2025
Última ModificaçãoJune 20, 2025
Aplica-se àArcGIS Pro SDK for .NET
Versão encontrada3.5
Sistema OperacionalWindows OS
Versão do Sistema Operacional11.0 64 bit
StatusAs Designed

Informações Adicionais

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

Etapas para Reproduzir

ID do Erro: BUG-000176904

Software:

  • ArcGIS Pro SDK for .NET

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download