_loadHeaders(); $this->_loadRecords(); if ($this->_isDbaseLoaded()) { $this->_closeDBFFile(); } } /** * Loads metadata from the ESRI shape file header * * @return void * @see ShapeFile::_loadHeaders() */ function _loadHeaders() { ImportShp::readFromBuffer(24); $this->fileLength = loadData("N", ImportShp::readFromBuffer(4)); ImportShp::readFromBuffer(4); $this->shapeType = loadData("V", ImportShp::readFromBuffer(4)); $this->boundingBox = array(); $this->boundingBox["xmin"] = loadData("d", ImportShp::readFromBuffer(8)); $this->boundingBox["ymin"] = loadData("d", ImportShp::readFromBuffer(8)); $this->boundingBox["xmax"] = loadData("d", ImportShp::readFromBuffer(8)); $this->boundingBox["ymax"] = loadData("d", ImportShp::readFromBuffer(8)); if ($this->_isDbaseLoaded() && $this->_openDBFFile()) { $this->DBFHeader = $this->_loadDBFHeader(); } } /** * Loads geometry data from the ESRI shape file * * @return boolean|void * @see ShapeFile::_loadRecords() */ function _loadRecords() { global $eof; ImportShp::readFromBuffer(32); while (true) { $record = new PMA_ShapeRecord(-1); $record->loadFromFile($this->SHPFile, $this->DBFFile); if ($record->lastError != "") { return false; } if ($eof) { break; } $this->records[] = $record; } } } ?>