예제 #1
0
        public static ShapeMatchCriterion GetDefaultShapeMatchCriterion(
            [CanBeNull] XmlVerificationOptions verificationOptions)
        {
            const ShapeMatchCriterion defaultValue = ShapeMatchCriterion.EqualEnvelope;

            if (verificationOptions == null)
            {
                return(defaultValue);
            }

            XmlExceptionConfiguration exceptions = verificationOptions.Exceptions;

            return(exceptions?.DefaultShapeMatchCriterion ?? defaultValue);
        }
예제 #2
0
        public ExceptionObjectFactory(
            [NotNull] ITable table,
            [NotNull] IIssueTableFields fields,
            [CanBeNull] IAlternateKeyConverterProvider alternateKeyConverterProvider = null,
            ShapeMatchCriterion defaultShapeMatchCriterion = ShapeMatchCriterion.EqualEnvelope,
            ExceptionObjectStatus defaultStatus            = ExceptionObjectStatus.Active,
            [CanBeNull] IGeometry areaOfInterest           = null,
            bool includeManagedExceptionAttributes         = false) : base(table, fields)
        {
            _alternateKeyConverterProvider = alternateKeyConverterProvider;
            _defaultShapeMatchCriterion    = defaultShapeMatchCriterion;
            _defaultStatus  = defaultStatus;
            _areaOfInterest = areaOfInterest;

            _tableSupportsNullValues =
                !WorkspaceUtils.IsShapefileWorkspace(DatasetUtils.GetWorkspace(table));

            _featureClass = table as IFeatureClass;
            _shapeType    = _featureClass?.ShapeType;

            _xyTolerance = _featureClass == null
                                               ? (double?)null
                                               : GetXyTolerance(_featureClass);

            _uuidIndex                = GetIndex(IssueAttribute.QualityConditionUuid);
            _versionUuidIndex         = GetIndex(IssueAttribute.QualityConditionVersionUuid);
            _issueCodeIndex           = GetIndex(IssueAttribute.IssueCode);
            _affectedComponentIndex   = GetIndex(IssueAttribute.AffectedComponent);
            _involvedObjectsIndex     = GetIndex(IssueAttribute.InvolvedObjects);
            _shapeMatchCriterionIndex = GetIndex(IssueAttribute.ExceptionShapeMatchCriterion,
                                                 optional: true);
            _exceptionStatusIndex = GetIndex(IssueAttribute.ExceptionStatus, optional: true);

            _doubleValue1Index = GetIndex(IssueAttribute.DoubleValue1, optional: true);
            _doubleValue2Index = GetIndex(IssueAttribute.DoubleValue2, optional: true);
            _textValueIndex    = GetIndex(IssueAttribute.TextValue, optional: true);

            _exceptionCategoryIndex = GetIndex(IssueAttribute.ExceptionCategory,
                                               optional: true);

            if (includeManagedExceptionAttributes)
            {
                // get managed exception attribute field indexes
                _managedOriginIndex = GetIndex(IssueAttribute.ManagedExceptionOrigin,
                                               optional: true);
                _managedLineageUuidIndex = GetIndex(IssueAttribute.ManagedExceptionLineageUuid,
                                                    optional: true);
                _managedVersionBeginDateIndex =
                    GetIndex(IssueAttribute.ManagedExceptionVersionBeginDate,
                             optional: true);
                _managedVersionEndDateIndex =
                    GetIndex(IssueAttribute.ManagedExceptionVersionEndDate,
                             optional: true);
                _managedVersionUuidIndex = GetIndex(IssueAttribute.ManagedExceptionVersionUuid,
                                                    optional: true);
                _managedVersionImportOriginIndex = GetIndex(
                    IssueAttribute.ManagedExceptionVersionOrigin,
                    optional: true);
            }

            _fieldNames = GetFieldNames(fields, table,
                                        GetIssueAttributes(includeManagedExceptionAttributes))
                          .ToList();
        }