Пример #1
0
 public BoundingBox(ShpReader reader)
 {
     _xMin = reader.ReadDouble();
     _yMin = reader.ReadDouble();
     _xMax = reader.ReadDouble();
     _yMax = reader.ReadDouble();
 }
Пример #2
0
        public Polygon(ShpReader reader)
            : base(reader)
        {
            _shapeType = reader.ReadInt();
            Debug.Assert(_shapeType == 5);

            _box       = new BoundingBox(reader);
            _numParts  = reader.ReadInt();
            _numPoints = reader.ReadInt();
            _parts     = reader.ReadInts(_numParts);
            _points    = reader.ReadPoints(_numPoints);
        }
Пример #3
0
        private void Read(Stream stream)
        {
            using (ShpReader reader = new ShpReader(stream))
            {
                Header = new FileHeader(reader);

                while (reader.Position < (Header.FileLength * 2))
                {
                    if (Header.ShapeType == ShapeType.Polygon)
                    {
                        _shapes.Add(new Polygon(reader));
                    }
                    else
                    {
                        new ByteHolder(reader);
                    }
                }
            }
        }
Пример #4
0
        public FileHeader(ShpReader reader)
        {
            _fileCode   = reader.ReadIntBigEndian();
            _unused1    = reader.ReadIntBigEndian();
            _unused2    = reader.ReadIntBigEndian();
            _unused3    = reader.ReadIntBigEndian();
            _unused4    = reader.ReadIntBigEndian();
            _unused5    = reader.ReadIntBigEndian();
            _fileLength = reader.ReadIntBigEndian();
            _version    = reader.ReadInt();
            _shapeType  = reader.ReadInt();
            _xMin       = reader.ReadDouble();
            _yMin       = reader.ReadDouble();
            _xMax       = reader.ReadDouble();
            _yMax       = reader.ReadDouble();
            _zMin       = reader.ReadDouble();
            _zMax       = reader.ReadDouble();
            _mMin       = reader.ReadDouble();
            _mMax       = reader.ReadDouble();

            reader.AssertPosition(100);
        }
Пример #5
0
 public IndexRecord(ShpReader reader)
 {
     _offset = reader.ReadIntBigEndian();
     _length = reader.ReadIntBigEndian();
 }
Пример #6
0
 public Shape(ShpReader reader)
 {
     _header = new ShapeHeader(reader);
 }
Пример #7
0
 public ShapeHeader(ShpReader reader)
 {
     _number = reader.ReadIntBigEndian();
     _length = reader.ReadIntBigEndian();
 }
Пример #8
0
 public ByteHolder(ShpReader reader)
     : base(reader)
 {
     _bytes = reader.ReadBytes(Header.Length);
 }