Example #1
0
 /**
  * Adds record to shape file
  *
  * @param ShapeRecord $record
  *
  * @return integer Number of added record
  */
 public function addRecord($record)
 {
     if (isset($this->DBFHeader) && is_array($this->DBFHeader)) {
         $record->updateDBFInfo($this->DBFHeader);
     }
     $this->fileLength += $record->getContentLength() + 4;
     $this->records[] = $record;
     $this->records[count($this->records) - 1]->recordNumber = count($this->records);
     $this->updateBBox('x', $record->SHPData);
     $this->updateBBox('y', $record->SHPData);
     if (in_array($this->shapeType, array(11, 13, 15, 18, 21, 23, 25, 28))) {
         $this->updateBBox('m', $record->SHPData);
     }
     if (in_array($this->shapeType, array(11, 13, 15, 18))) {
         $this->updateBBox('z', $record->SHPData);
     }
     return count($this->records) - 1;
 }