src/ShapeFile.php
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, [11, 13, 15, 18, 21, 23, 25, 28])) {
            $this->updateBBox('m', $record->SHPData);
        }

        if (in_array($this->shapeType, [11, 13, 15, 18])) {
            $this->updateBBox('z', $record->SHPData);
        }

        return count($this->records) - 1;
    }
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, [11, 13, 15, 18, 21, 23, 25, 28])) {
            $this->updateBBox('m', $record->SHPData);
        }

        if (in_array($this->shapeType, [11, 13, 15, 18])) {
            $this->updateBBox('z', $record->SHPData);
        }

        return count($this->records) - 1;
    }
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 , [ 11 , 13 , 15 , 18 , 21 , 23 , 25 , 28 ] ) ) { $ this -> updateBBox ( 'm' , $ record -> SHPData ) ; } if ( in_array ( $ this -> shapeType , [ 11 , 13 , 15 , 18 ] ) ) { $ this -> updateBBox ( 'z' , $ record -> SHPData ) ; } return count ( $ this -> records ) - 1 ; }
Adds record to shape file.

@param ShapeRecord $record

@return int Number of added record
Adds record to shape file .