Exemplo n.º 1
0
        protected override int CompleteTileCore(TileInfo args)
        {
            if (args.State == TileState.Initial)
            {
                return(NoError);
            }

            int errorCount = base.CompleteTileCore(args);

            if (ConnectedLinesList == null)
            {
                return(errorCount);
            }

            errorCount += ConnectedLinesList.Sum(connectedRows => ResolveRows(connectedRows));

            foreach (LineList <DirectedRow> list in
                     _grower.GetAndRemoveCollectionsInside(args.ProcessedEnvelope))
            {
                // these are all not closed polygons and hence errors
                const string description = "Incomplete line";

                errorCount += ReportError(description,
                                          CreateUnclosedErrorGeometry(list),
                                          Codes[Code.IncompleteLine],
                                          TestUtils.GetShapeFieldName(
                                              (IFeature)list.DirectedRows.First.Value.Row.Row),
                                          InvolvedRow.CreateList(
                                              list.GetUniqueRows(InvolvedTables)));
            }

            return(errorCount);
        }
Exemplo n.º 2
0
        protected override int CompleteTileCore(TileInfo args)
        {
            if (args.State == TileState.Initial)
            {
                _netCache?.Clear();
                ConnectedLinesList?.Clear();
                ConnectedElementsList?.Clear();
                return(0);
            }

            if (_netCache == null)
            {
                return(0);
            }

            ConnectedLinesList?.Clear();
            ConnectedElementsList?.Clear();

            IEnvelope   verificationBox = Assert.NotNull(args.AllBox, "AllBox");
            WKSEnvelope verificationEnvelope;

            verificationBox.QueryWKSCoords(out verificationEnvelope);

            IEnvelope   tileBox = Assert.NotNull(args.CurrentEnvelope, "CurrentEnvelope");
            WKSEnvelope tileEnvelope;

            tileBox.QueryWKSCoords(out tileEnvelope);

            BuildToleranceCache(tileEnvelope);

            BuildNet(verificationEnvelope, tileEnvelope, Tolerance);
            _netCache.Clear();

            return(0);
        }
Exemplo n.º 3
0
        protected override int CompleteTileCore(TileInfo args)
        {
            var errorCount = 0;

            if (args.State == TileState.Initial)
            {
                return(errorCount);
            }

            errorCount += base.CompleteTileCore(args);
            if (ConnectedLinesList == null)
            {
                return(errorCount);
            }

            errorCount +=
                ConnectedLinesList.Sum(connectedRows => ResolveRows(connectedRows));

            List <LineList <DirectedRow> > outerRingList;
            List <LineList <DirectedRow> > innerRingList;
            List <DirectedRow>             innerLineList;
            IEnvelope outerRingsBox;

            IEnvelope processedEnvelope = args.ProcessedEnvelope ?? args.AllBox;

            Assert.NotNull(processedEnvelope, "processedEnvelope");

            PrepareOuterRings(processedEnvelope, out outerRingList, out outerRingsBox);
            if (outerRingsBox == null)
            {
                return(errorCount);
            }

            PrepareInnerRings(outerRingsBox, out innerRingList, out innerLineList);

            PolygonNet <DirectedRow> polyList =
                PolygonNet <DirectedRow> .Create(outerRingList,
                                                 outerRingsBox,
                                                 innerRingList,
                                                 innerLineList);

            errorCount += AssignCentroids(polyList);
            errorCount += CheckCentroids(polyList);

            if (_constraint != null)
            {
                errorCount += CheckConstraint(polyList);
            }

            Drop(polyList);

            return(errorCount);
        }