示例#1
0
        public void Load()
        {
            FileCode = Util.FromBigEndian(br.ReadInt32());
            br.BaseStream.Seek(20, SeekOrigin.Current);
            FileLength  = Util.FromBigEndian(br.ReadInt32()) * 2;
            FileVersion = br.ReadInt32();
            ShpType     = (ShapeType)br.ReadInt32();

            TotalXYRange = new RangeXY();
            ZRange       = new Range();
            MRange       = new Range();
            TotalXYRange.Load(ref br);
            ZRange.Load(ref br);
            MRange.Load(ref br);

            ContentLength = FileLength - 100;
            long curPoint = 0;

            RecordSet = new List <ShpRecord>();
            while (curPoint < ContentLength)
            {
                ShpRecord record = new ShpRecord(ShpType);
                record.Load(ref br);
                long size = record.GetLength();
                RecordSet.Add(record);

                curPoint += record.GetLength();
            }
        }
示例#2
0
        public IRecord GetData(ShapeType type, int offset, int length)
        {
            br.BaseStream.Seek(offset, SeekOrigin.Begin);
            IRecord record = new ShpRecord(type);

            record.Load(ref br);
            return(record);
        }