我必须合并一组多边形来创建一个新的多边形。
有时会发生我在多边形之间有小洞,所以当我尝试合并它们时,我会收到一个错误。
我怎样才能检测到这个并解决?
更新一些错误示例
side location conflict [ (12.235768128349596, 44.387249570104892, NaN) ]
at NetTopologySuite.Operation.Overlay.Snap.SnapIfNeededOverlayOp.GetResultGeometry(SpatialFunction opCode)
at NetTopologySuite.Geometries.Geometry.Union(IGeometry other)
at NetTopologySuite.Operation.Union.CascadedPolygonUnion.UnionOptimized(IGeometry g0, IGeometry g1)
at NetTopologySuite.Operation.Union.CascadedPolygonUnion.Union()
at NetTopologySuite.Operation.Union.UnaryUnionOp.Union()
或者
found non-noded intersection between LINESTRING(12.448591764796777 41.972860890341124, 12.448731325430401 41.972841479998927) and LINESTRING(12.449 41.973, 12.448695198462875 41.972831837041554) [ (12.448716431340822, 41.972843551495508, NaN) ]
at NetTopologySuite.Noding.FastNodingValidator.CheckValid()
at NetTopologySuite.Operation.Overlay.OverlayOp.ComputeOverlay(SpatialFunction opCode)
at NetTopologySuite.Operation.Overlay.OverlayOp.Overlay(IGeometry geom0, IGeometry geom1, SpatialFunction opCode)
或者
Invalid number of points in LineString (found 1 - must be 0 or >= 2)
at NetTopologySuite.Geometries.LineString..ctor(ICoordinateSequence points, IGeometryFactory factory)
at NetTopologySuite.Geometries.GeometryFactory.CreatePolygon(ICoordinateSequence coordinates)