src/ShapeRecord.php
public function deletePoint($pointIndex = 0, $partIndex = 0)
    {
        switch ($this->shapeType) {
            case 0:
                //Don't delete anything
                break;
            case 1:
            case 11:
            case 21:
                //Sets the value of the point to zero
                $this->SHPData['x'] = 0.0;
                $this->SHPData['y'] = 0.0;
                if (in_array($this->shapeType, [11, 21])) {
                    $this->SHPData['m'] = 0.0;
                }
                if (in_array($this->shapeType, [11])) {
                    $this->SHPData['z'] = 0.0;
                }
                break;
            case 3:
            case 5:
            case 13:
            case 15:
            case 23:
            case 25:
                //Deletes the point from the selected part, if exists
                if (isset($this->SHPData['parts'][$partIndex]) && isset($this->SHPData['parts'][$partIndex]['points'][$pointIndex])) {
                    $count = count($this->SHPData['parts'][$partIndex]['points']) - 1;
                    for ($i = $pointIndex; $i < $count; ++$i) {
                        $this->SHPData['parts'][$partIndex]['points'][$i] = $this->SHPData['parts'][$partIndex]['points'][$i + 1];
                    }
                    unset($this->SHPData['parts'][$partIndex]['points'][count($this->SHPData['parts'][$partIndex]['points']) - 1]);

                    $this->SHPData['numparts'] = count($this->SHPData['parts']);
                    --$this->SHPData['numpoints'];
                }
                break;
            case 8:
            case 18:
            case 28:
                //Deletes the point, if exists
                if (isset($this->SHPData['points'][$pointIndex])) {
                    $count = count($this->SHPData['points']) - 1;
                    for ($i = $pointIndex; $i < $count; ++$i) {
                        $this->SHPData['points'][$i] = $this->SHPData['points'][$i + 1];
                    }
                    unset($this->SHPData['points'][count($this->SHPData['points']) - 1]);

                    --$this->SHPData['numpoints'];
                }
                break;
            default:
                $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType));
                break;
        }
    }
public function deletePoint($pointIndex = 0, $partIndex = 0)
    {
        switch ($this->shapeType) {
            case 0:
                //Don't delete anything
                break;
            case 1:
            case 11:
            case 21:
                //Sets the value of the point to zero
                $this->SHPData['x'] = 0.0;
                $this->SHPData['y'] = 0.0;
                if (in_array($this->shapeType, [11, 21])) {
                    $this->SHPData['m'] = 0.0;
                }
                if (in_array($this->shapeType, [11])) {
                    $this->SHPData['z'] = 0.0;
                }
                break;
            case 3:
            case 5:
            case 13:
            case 15:
            case 23:
            case 25:
                //Deletes the point from the selected part, if exists
                if (isset($this->SHPData['parts'][$partIndex]) && isset($this->SHPData['parts'][$partIndex]['points'][$pointIndex])) {
                    $count = count($this->SHPData['parts'][$partIndex]['points']) - 1;
                    for ($i = $pointIndex; $i < $count; ++$i) {
                        $this->SHPData['parts'][$partIndex]['points'][$i] = $this->SHPData['parts'][$partIndex]['points'][$i + 1];
                    }
                    unset($this->SHPData['parts'][$partIndex]['points'][count($this->SHPData['parts'][$partIndex]['points']) - 1]);

                    $this->SHPData['numparts'] = count($this->SHPData['parts']);
                    --$this->SHPData['numpoints'];
                }
                break;
            case 8:
            case 18:
            case 28:
                //Deletes the point, if exists
                if (isset($this->SHPData['points'][$pointIndex])) {
                    $count = count($this->SHPData['points']) - 1;
                    for ($i = $pointIndex; $i < $count; ++$i) {
                        $this->SHPData['points'][$i] = $this->SHPData['points'][$i + 1];
                    }
                    unset($this->SHPData['points'][count($this->SHPData['points']) - 1]);

                    --$this->SHPData['numpoints'];
                }
                break;
            default:
                $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType));
                break;
        }
    }
public function deletePoint ( $ pointIndex = 0 , $ partIndex = 0 ) { switch ( $ this -> shapeType ) { case 0 : //Don't delete anything break ; case 1 : case 11 : case 21 : //Sets the value of the point to zero $ this -> SHPData [ 'x' ] = 0.0 ; $ this -> SHPData [ 'y' ] = 0.0 ; if ( in_array ( $ this -> shapeType , [ 11 , 21 ] ) ) { $ this -> SHPData [ 'm' ] = 0.0 ; } if ( in_array ( $ this -> shapeType , [ 11 ] ) ) { $ this -> SHPData [ 'z' ] = 0.0 ; } break ; case 3 : case 5 : case 13 : case 15 : case 23 : case 25 : //Deletes the point from the selected part, if exists if ( isset ( $ this -> SHPData [ 'parts' ] [ $ partIndex ] ) && isset ( $ this -> SHPData [ 'parts' ] [ $ partIndex ] [ 'points' ] [ $ pointIndex ] ) ) { $ count = count ( $ this -> SHPData [ 'parts' ] [ $ partIndex ] [ 'points' ] ) - 1 ; for ( $ i = $ pointIndex ; $ i < $ count ; ++ $ i ) { $ this -> SHPData [ 'parts' ] [ $ partIndex ] [ 'points' ] [ $ i ] = $ this -> SHPData [ 'parts' ] [ $ partIndex ] [ 'points' ] [ $ i + 1 ] ; } unset ( $ this -> SHPData [ 'parts' ] [ $ partIndex ] [ 'points' ] [ count ( $ this -> SHPData [ 'parts' ] [ $ partIndex ] [ 'points' ] ) - 1 ] ) ; $ this -> SHPData [ 'numparts' ] = count ( $ this -> SHPData [ 'parts' ] ) ; -- $ this -> SHPData [ 'numpoints' ] ; } break ; case 8 : case 18 : case 28 : //Deletes the point, if exists if ( isset ( $ this -> SHPData [ 'points' ] [ $ pointIndex ] ) ) { $ count = count ( $ this -> SHPData [ 'points' ] ) - 1 ; for ( $ i = $ pointIndex ; $ i < $ count ; ++ $ i ) { $ this -> SHPData [ 'points' ] [ $ i ] = $ this -> SHPData [ 'points' ] [ $ i + 1 ] ; } unset ( $ this -> SHPData [ 'points' ] [ count ( $ this -> SHPData [ 'points' ] ) - 1 ] ) ; -- $ this -> SHPData [ 'numpoints' ] ; } break ; default : $ this -> setError ( sprintf ( 'The Shape Type "%s" is not supported.' , $ this -> shapeType ) ) ; break ; } }
Deletes point from a record.

@param int $pointIndex Point index
@param int $partIndex  Part index
Deletes point from a record .