예제 #1
0
 private Feature FindFeatureByLnam(LongName lnam)
 {
     if (Features.ContainsKey(lnam))
     {
         return(Features[lnam]);
     }
     else
     {
         return(null);
     }
 }
예제 #2
0
        private void DeleteFeatureByFRID(Feature feature)
        {
            LongName lnam = new LongName();

            foreach (Feature f in Features.Values)
            {
                if (f.cell.DataSetName == feature.cell.DataSetName &&
                    f.RecordIdentificationNumber == feature.RecordIdentificationNumber)
                {
                    lnam = f.lnam;
                }
            }
            if (lnam.ProducingAgency != 0 && lnam.FeatureIdentificationNumber != 0 && lnam.FeatureIdentificationSubdivision != 0)
            {
                Features.Remove(lnam);
            }
        }
예제 #3
0
        public Feature(NAMEkey _namekey, DataRecord _FeatureRecord)
        {
            namekey       = _namekey;
            FeatureRecord = _FeatureRecord;
            var fspt = _FeatureRecord.Fields.GetFieldByTag("FSPT");

            if (fspt != null)
            {
                enhVectorPtrs = new VectorRecordPointer(fspt.subFields);
            }
            var ffpt = _FeatureRecord.Fields.GetFieldByTag("FFPT");

            if (ffpt != null)
            {
                enhFeaturePtrs = new FeatureObjectPointer(ffpt.subFields);
            }
            // FRID : Feature Record Identifier
            var frid = _FeatureRecord.Fields.GetFieldByTag("FRID");

            if (frid != null)
            {
                Primitive  = (GeometricPrimitive)frid.subFields.GetUInt32(0, "PRIM");
                Group      = frid.subFields.GetUInt32(0, "GRUP");
                ObjectCode = (S57Obj)frid.subFields.GetUInt32(0, "OBJL");
            }
            // FOID : Feature Object Identifier
            var foid = _FeatureRecord.Fields.GetFieldByTag("FOID");

            if (foid != null)
            {
                subFieldRow = foid.subFields.Values[0];
                tagLookup   = foid.subFields.TagIndex;
                agen        = subFieldRow.GetUInt32(tagLookup["AGEN"]);
                fidn        = subFieldRow.GetUInt32(tagLookup["FIDN"]);
                fids        = subFieldRow.GetUInt32(tagLookup["FIDS"]);
                lnam        = new LongName(agen, fidn, fids);
            }
            // ATTF : Attributes
            var attr = _FeatureRecord.Fields.GetFieldByTag("ATTF");

            if (attr != null)
            {
                Attributes = Vector.GetAttributes(attr);
            }
            // NATF : National attributes NATF.
            var natf = _FeatureRecord.Fields.GetFieldByTag("NATF");

            if (natf != null)
            {
                var natfAttr = Vector.GetAttributes(natf);
                if (Attributes != null)
                {
                    foreach (var entry in natfAttr)
                    {
                        Attributes.Add(entry.Key, entry.Value);
                    }
                }
                else
                {
                    Attributes = natfAttr;
                }
            }
        }
예제 #4
0
        public Feature(DataRecord record, BaseFile baseFile, Cell cell)
        {
            _dataRecord = record;

            this.baseFile = baseFile;
            this.cell     = cell;

            var v001 = record.Fields.GetFieldByTag("0001");

            // FRID : Feature Record Identifier
            var frid = record.Fields.GetFieldByTag("FRID");

            if (frid != null)
            {
                RecordIdentificationNumber = frid.GetUInt32("RCNM");
                RecordName              = frid.GetUInt32("RCID");
                Primitive               = (GeometricPrimitive)frid.GetUInt32("PRIM");
                Group                   = frid.GetUInt32("GRUP");
                Code                    = frid.GetUInt32("OBJL");
                RecordVersion           = frid.GetUInt32("RVER");
                RecordUpdateInstruction = (RecordUpdate)frid.GetUInt32("RUIN");
            }

            // FOID : Feature Object Identifier
            var foid = record.Fields.GetFieldByTag("FOID");

            if (foid != null)
            {
                var agen = foid.GetUInt32("AGEN");
                var fidn = foid.GetUInt32("FIDN");
                var fids = foid.GetUInt32("FIDS");
                lnam = new LongName(agen, fidn, fids);
            }

            // ATTF : Attributes
            var attr = record.Fields.GetFieldByTag("ATTF");

            if (attr != null)
            {
                Attributes = GetAttributes(attr, baseFile);
            }

            // NATF : National attributes NATF.
            var natf = record.Fields.GetFieldByTag("NATF");

            if (natf != null)
            {
                var natfAttr = GetAttributes(natf, baseFile);
                if (Attributes != null)
                {
                    foreach (var entry in natfAttr)
                    {
                        Attributes.Add(entry.Key, entry.Value);
                    }
                }
                else
                {
                    Attributes = natfAttr;
                }
            }

            // FFPC : Feature Record To Feature Object Pointer Control
            var ffpc = record.Fields.GetFieldByTag("FFPC");

            if (ffpc != null)
            {
                FeatureObjectPointerUpdateInstruction = (RecordUpdate)ffpc.GetUInt32("FFUI");
                FeatureObjectPointerIndex             = ffpc.GetUInt32("FFIX");
                NumberOfFeatureObjectPointers         = ffpc.GetUInt32("NFPT");
            }

            // <R> FFPT : Feature Record To Feature Object Pointer
            var ffpt = record.Fields.GetFieldByTag("FFPT");

            if (ffpt != null)
            {
                FeaturePtrs = GetFFPTs(ffpt);
                //var lnam = new LongName(ffpt.GetBytes("LNAM"));
                //var rind = ffpt.GetUInt32("RIND");
                //var comt = ffpt.GetString("COMT");
            }


            // FSPC : Feature Record to Spatial Record Pointer Control
            var fspc = record.Fields.GetFieldByTag("FSPC");

            if (fspc != null)
            {
                FeatureToSpatialRecordPointerUpdateInstruction = (RecordUpdate)fspc.GetUInt32("FSUI");
                FeatureToSpatialRecordPointerIndex             = fspc.GetUInt32("FSIX");
                NumberOfFeatureToSpatialRecordPointers         = fspc.GetUInt32("NSPT");
            }

            // FSPT : Feature Record to Spatial Record Pointer
            var fspt = record.Fields.GetFieldByTag("FSPT");

            if (fspt != null)
            {
                VectorPtrs = GetFSPTs(fspt);
            }
        }