src/ShapeFile.php
private function _loadHeaders()
    {
        if (Util::loadData('N', $this->readSHP(4)) != self::MAGIC) {
            $this->setError('Not a SHP file (file code mismatch)');

            return false;
        }

        /* Skip 20 unused bytes */
        $this->readSHP(20);

        $this->fileLength = Util::loadData('N', $this->readSHP(4));

        /* We currently ignore version */
        $this->readSHP(4);

        $this->shapeType = Util::loadData('V', $this->readSHP(4));

        $this->boundingBox = [];
        $this->boundingBox['xmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['ymin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['xmax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['ymax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['zmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['zmax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['mmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['mmax'] = Util::loadData('d', $this->readSHP(8));

        if (self::supportsDbase()) {
            $this->DBFHeader = $this->_loadDBFHeader();
        }

        return true;
    }
private function _loadHeaders()
    {
        if (Util::loadData('N', $this->readSHP(4)) != self::MAGIC) {
            $this->setError('Not a SHP file (file code mismatch)');

            return false;
        }

        /* Skip 20 unused bytes */
        $this->readSHP(20);

        $this->fileLength = Util::loadData('N', $this->readSHP(4));

        /* We currently ignore version */
        $this->readSHP(4);

        $this->shapeType = Util::loadData('V', $this->readSHP(4));

        $this->boundingBox = [];
        $this->boundingBox['xmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['ymin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['xmax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['ymax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['zmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['zmax'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['mmin'] = Util::loadData('d', $this->readSHP(8));
        $this->boundingBox['mmax'] = Util::loadData('d', $this->readSHP(8));

        if (self::supportsDbase()) {
            $this->DBFHeader = $this->_loadDBFHeader();
        }

        return true;
    }
private function _loadHeaders ( ) { if ( Util :: loadData ( 'N' , $ this -> readSHP ( 4 ) ) != self :: MAGIC ) { $ this -> setError ( 'Not a SHP file (file code mismatch)' ) ; return false ; } /* Skip 20 unused bytes */ $ this -> readSHP ( 20 ) ; $ this -> fileLength = Util :: loadData ( 'N' , $ this -> readSHP ( 4 ) ) ; /* We currently ignore version */ $ this -> readSHP ( 4 ) ; $ this -> shapeType = Util :: loadData ( 'V' , $ this -> readSHP ( 4 ) ) ; $ this -> boundingBox = [ ] ; $ this -> boundingBox [ 'xmin' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; $ this -> boundingBox [ 'ymin' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; $ this -> boundingBox [ 'xmax' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; $ this -> boundingBox [ 'ymax' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; $ this -> boundingBox [ 'zmin' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; $ this -> boundingBox [ 'zmax' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; $ this -> boundingBox [ 'mmin' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; $ this -> boundingBox [ 'mmax' ] = Util :: loadData ( 'd' , $ this -> readSHP ( 8 ) ) ; if ( self :: supportsDbase ( ) ) { $ this -> DBFHeader = $ this -> _loadDBFHeader ( ) ; } return true ; }
Loads SHP file metadata.

@return bool
Loads SHP file metadata .