Esempio n. 1
0
        private bool IsBackward([NotNull] DirectedRow dirRow)
        {
            RowCondition flipCondition = GetFlipCondition(dirRow.Row);

            return(flipCondition != null && flipCondition.IsFulfilled(dirRow.Row.Row)
                                       ? !dirRow.IsBackward
                                       : dirRow.IsBackward);
        }
Esempio n. 2
0
        protected override int ExecuteCore(IRow row, int tableIndex)
        {
            if (!_hasM)
            {
                return(NoError);
            }

            var feature = row as IFeature;

            if (feature == null)
            {
                return(NoError);
            }

            var polyline = feature.Shape as IPolyline;

            if (polyline == null)
            {
                return(NoError);
            }

            if (_flipCondition == null)
            {
                const bool undefinedConstraintIsFulfilled = false;
                _flipCondition = new RowCondition((ITable)_lineClass, _flipExpression,
                                                  undefinedConstraintIsFulfilled,
                                                  GetSqlCaseSensitivity(tableIndex));
            }

            var mAware = (IMAware)polyline;

            Assert.True(mAware.MAware, "The geometry is not M-aware");

            IEnumerable <MMonotonicitySequence> errorSequences = MeasureUtils.GetErrorSequences(
                polyline, _expectedMonotonicity,
                () => _flipCondition.IsFulfilled(feature),
                _allowConstantValues);

            return(errorSequences.Sum(errorSequence => ReportError(
                                          GetErrorMessage(errorSequence),
                                          errorSequence.CreatePolyline(),
                                          Codes[Code.MeasuresNotMonotonic],
                                          TestUtils.GetShapeFieldName(feature),
                                          row)));
        }