Esempio n. 1
0
        protected override int FindErrors(IRow row1, int tableIndex1,
                                          IRow row2, int tableIndex2)
        {
            Assert.ArgumentNotNull(row1, nameof(row1));
            Assert.ArgumentNotNull(row2, nameof(row2));

            if (row1 == row2)
            {
                return(NoError);
            }

            if (_matrixHelper == null)
            {
                const bool constraintIsDirected = false;
                _matrixHelper = new IntersectionMatrixHelper(
                    Assert.NotNull(IntersectionMatrix, "matrix"),
                    _constraint, constraintIsDirected,
                    QaSpatialRelationUtils.ParseDimensions(_validIntersectionDimensions),
                    GetSqlCaseSensitivity());
            }

            const bool reportIndividualErrors = true;

            return(_matrixHelper.ReportErrors((IFeature)row1, tableIndex1,
                                              (IFeature)row2, tableIndex2,
                                              this, GetIssueCode(),
                                              reportIndividualErrors));
        }
Esempio n. 2
0
        protected override int FindErrors(IRow row1, int tableIndex1, IRow row2,
                                          int tableIndex2)
        {
            if (_validRelationConstraint == null)
            {
                const bool constraintIsDirected = true;
                _validRelationConstraint = new ValidRelationConstraint(
                    _validRelationConstraintSql,
                    constraintIsDirected,
                    GetSqlCaseSensitivity());
            }

            return(QaSpatialRelationUtils.ReportTouches(row1, tableIndex1,
                                                        row2, tableIndex2,
                                                        this, GetIssueCode(),
                                                        _validRelationConstraint,
                                                        _validTouchGeometryConstraint,
                                                        reportIndividualParts: true));
        }
Esempio n. 3
0
        protected override int FindErrors(IRow row1, int tableIndex1,
                                          IRow row2, int tableIndex2)
        {
            if (_validRelationConstraint == null)
            {
                const bool constraintIsDirected = true;
                _validRelationConstraint = new ValidRelationConstraint(
                    _validRelationConstraintSql, constraintIsDirected,
                    GetSqlCaseSensitivity());
            }

            return(QaSpatialRelationUtils.ReportIntersections(
                       row1, tableIndex1,
                       row2, tableIndex2,
                       this, GetIssueCode(),
                       _validRelationConstraint,
                       !ReportIntersectionsAsMultipart,
                       _validIntersectionGeometryConstraint));
        }
Esempio n. 4
0
        protected override int FindErrors(IRow row1, int tableIndex1,
                                          IRow row2, int tableIndex2)
        {
            if (_validRelationConstraint == null)
            {
                const bool constraintIsDirected = true;
                _validRelationConstraint = new ValidRelationConstraint(
                    _validRelationConstraintSql,
                    constraintIsDirected,
                    GetSqlCaseSensitivity());
            }

            const bool reportIndividualErrors = false;

            return(QaSpatialRelationUtils.ReportOverlaps(row1, tableIndex1,
                                                         row2, tableIndex2,
                                                         this, GetIssueCode(),
                                                         _validRelationConstraint,
                                                         reportIndividualErrors));
        }
        protected override int FindErrors(IRow row1, int tableIndex1,
                                          IRow row2, int tableIndex2)
        {
            Assert.ArgumentNotNull(row1, nameof(row1));
            Assert.ArgumentNotNull(row2, nameof(row2));

            if (row1 == row2)
            {
                return(NoError);
            }

            var feature1 = (IFeature)row1;
            var feature2 = (IFeature)row2;

            // if the test is made from a To row to a From row, then the roles of the features must
            // be inverted
            bool swapRoles = !IsInFromTableList(tableIndex1);

            if (_matrixHelper == null)
            {
                const bool constraintIsDirected = true;
                _matrixHelper = new IntersectionMatrixHelper(
                    Assert.NotNull(IntersectionMatrix, "matrix"),
                    _constraint, constraintIsDirected,
                    QaSpatialRelationUtils.ParseDimensions(_validIntersectionDimensions),
                    GetSqlCaseSensitivity());
            }

            const bool reportIndividualErrors = true;

            return(swapRoles
                                       ? _matrixHelper.ReportErrors(feature2, tableIndex2,
                                                                    feature1, tableIndex1,
                                                                    this, GetIssueCode(),
                                                                    reportIndividualErrors)
                                       : _matrixHelper.ReportErrors(feature1, tableIndex1,
                                                                    feature2, tableIndex2,
                                                                    this, GetIssueCode(),
                                                                    reportIndividualErrors));
        }
        protected override int FindErrors(IRow row1, int tableIndex1,
                                          IRow row2, int tableIndex2)
        {
            if (_validRelationConstraint == null)
            {
                const bool constraintIsDirected = false;
                _validRelationConstraint = new ValidRelationConstraint(
                    _validRelationConstraintSql, constraintIsDirected,
                    GetSqlCaseSensitivity());
            }

            if (!_reportSingleErrorPerDuplicateSet)
            {
                return(QaSpatialRelationUtils.ReportDuplicates(row1, tableIndex1,
                                                               row2, tableIndex2,
                                                               this, GetIssueCode(),
                                                               _validRelationConstraint));
            }

            int oid1 = row1.OID;
            int oid2 = row2.OID;

            if (!IsKnownDuplicate(oid1, oid2))
            {
                string errorDescription;
                if (QaSpatialRelationUtils.AreDuplicates(
                        row1, tableIndex1,
                        row2, tableIndex2,
                        _validRelationConstraint,
                        out errorDescription))
                {
                    AddDuplicate(oid1, oid2);
                }
            }

            // duplicates will be reported at end
            return(NoError);
        }
Esempio n. 7
0
        public QaMustIntersectMatrixOther(
            [Doc(nameof(DocStrings.QaMustIntersectMatrixOther_featureClasses))][NotNull]
            ICollection <IFeatureClass> featureClasses,
            [Doc(nameof(DocStrings.QaMustIntersectMatrixOther_otherFeatureClasses))][NotNull]
            ICollection <IFeatureClass> otherFeatureClasses,
            [Doc(nameof(DocStrings.QaMustIntersectMatrixOther_intersectionMatrix))][NotNull]
            string
            intersectionMatrix,
            [Doc(nameof(DocStrings.QaMustIntersectMatrixOther_relevantRelationCondition))][CanBeNull]
            string
            relevantRelationCondition,
            [Doc(nameof(DocStrings.QaMustIntersectMatrixOther_requiredIntersectionDimensions))][CanBeNull]
            string
            requiredIntersectionDimensions,
            [Doc(nameof(DocStrings.QaMustIntersectMatrixOther_unallowedIntersectionDimensions))][CanBeNull]
            string
            unallowedIntersectionDimensions)
            : base(featureClasses, otherFeatureClasses, relevantRelationCondition)
        {
            Assert.ArgumentNotNullOrEmpty(intersectionMatrix, nameof(intersectionMatrix));

            _intersectionMatrices = new List <IntersectionMatrix>();
            foreach (string matrixString in TestUtils.GetTokens(intersectionMatrix))
            {
                _intersectionMatrices.Add(new IntersectionMatrix(matrixString));
            }

            _requiredDimensions =
                QaSpatialRelationUtils.ParseDimensions(requiredIntersectionDimensions);
            _unallowedDimensions =
                QaSpatialRelationUtils.ParseDimensions(unallowedIntersectionDimensions);

            _relationString = GetRelationString(_intersectionMatrices,
                                                _requiredDimensions,
                                                _unallowedDimensions);
        }