コード例 #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));
        }
コード例 #2
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(0);
            }

            if (_matrixHelper == null)
            {
                _matrixHelper = new IntersectionMatrixHelper(
                    Assert.NotNull(IntersectionMatrix, "matrix"),
                    _constraint,
                    constraintIsCaseSensitive: GetSqlCaseSensitivity(),
                    intersectionGeometryConstraint: _validIntersectionGeometryConstraint);
            }

            bool reportIndividualErrors = !_reportIntersectionsAsMultipart;

            return(_matrixHelper.ReportErrors((IFeature)row1, tableIndex1,
                                              (IFeature)row2, tableIndex2,
                                              this, GetIssueCode(),
                                              reportIndividualErrors));
        }
コード例 #3
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(0);
            }

            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,
                    constraintIsCaseSensitive: GetSqlCaseSensitivity(),
                    intersectionGeometryConstraint: _validIntersectionGeometryConstraint);
            }

            const bool reportIndividualErrors = true;

            return(swapRoles
                                       ? _matrixHelper.ReportErrors(feature2, tableIndex2,
                                                                    feature1, tableIndex1,
                                                                    this, GetIssueCode(),
                                                                    reportIndividualErrors)
                                       : _matrixHelper.ReportErrors(feature1, tableIndex1,
                                                                    feature2, tableIndex2,
                                                                    this, GetIssueCode(),
                                                                    reportIndividualErrors));
        }