/** * Loads geometry data from the ESRI shape file * * @return boolean|void * @see ShapeFile::_loadRecords() */ public function _loadRecords() { global $eof; ImportShp::readFromBuffer(32); while (true) { $record = new ShapeRecord(-1); $record->loadFromFile($this->SHPFile, $this->DBFFile); if ($record->lastError != "") { return false; } if ($eof) { break; } $this->records[] = $record; } }
function _loadRecords() { fseek($this->SHPFile, 100); while (!feof($this->SHPFile)) { $bByte = ftell($this->SHPFile); $record = new ShapeRecord(-1); $record->loadFromFile($this->SHPFile, $this->DBFFile); $eByte = ftell($this->SHPFile); if ($eByte <= $bByte || $record->lastError != "") { return false; } $this->records[] = $record; } }
/** * Loads records from SHP file (and DBF) * * @return boolean */ private function _loadRecords() { /* Need to start at offset 100 */ while (!$this->eofSHP()) { $record = new ShapeRecord(-1); $record->loadFromFile($this, $this->SHPFile, $this->DBFFile); if ($record->lastError != '') { $this->setError($record->lastError); return false; } if (($record->shapeType === false || $record->shapeType === '') && $this->eofSHP()) { break; } $this->records[] = $record; } return true; }
public function getNext() { if (!feof($this->fp)) { fseek($this->fp, $this->fpos); $shp_record = new ShapeRecord($this->fp, $this->dbf_filename, $this->options); if ($shp_record->getError() != "") { return false; } $this->fpos = $shp_record->getNextRecordPosition(); return $shp_record; } return false; }