/**
  * 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;
     }
 }
Example #2
0
 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;
     }
 }
Example #3
0
 /**
  * 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;
 }
Example #4
0
 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;
 }