src/ShapeRecord.php
public function getContentLength()
    {
        // The content length for a record is the length of the record contents section measured in 16-bit words.
        // one coordinate makes 4 16-bit words (64 bit double)
        switch ($this->shapeType) {
            case 0:
                $result = 0;
                break;
            case 1:
                $result = 10;
                break;
            case 21:
                $result = 10 + 4;
                break;
            case 11:
                $result = 10 + 8;
                break;
            case 3:
            case 5:
                $count = count($this->SHPData['parts']);
                $result = 22 + 2 * $count;
                for ($i = 0; $i < $count; ++$i) {
                    $result += 8 * count($this->SHPData['parts'][$i]['points']);
                }
                break;
            case 23:
            case 25:
                $count = count($this->SHPData['parts']);
                $result = 22 + (2 * 4) + 2 * $count;
                for ($i = 0; $i < $count; ++$i) {
                    $result += (8 + 4) * count($this->SHPData['parts'][$i]['points']);
                }
                break;
            case 13:
            case 15:
                $count = count($this->SHPData['parts']);
                $result = 22 + (4 * 4) + 2 * $count;
                for ($i = 0; $i < $count; ++$i) {
                    $result += (8 + 8) * count($this->SHPData['parts'][$i]['points']);
                }
                break;
            case 8:
                $result = 20 + 8 * count($this->SHPData['points']);
                break;
            case 28:
                $result = 20 + (2 * 4) + (8 + 4) * count($this->SHPData['points']);
                break;
            case 18:
                $result = 20 + (4 * 4) + (8 + 8) * count($this->SHPData['points']);
                break;
            default:
                $result = false;
                $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType));
                break;
        }

        return $result;
    }
public function getContentLength()
    {
        // The content length for a record is the length of the record contents section measured in 16-bit words.
        // one coordinate makes 4 16-bit words (64 bit double)
        switch ($this->shapeType) {
            case 0:
                $result = 0;
                break;
            case 1:
                $result = 10;
                break;
            case 21:
                $result = 10 + 4;
                break;
            case 11:
                $result = 10 + 8;
                break;
            case 3:
            case 5:
                $count = count($this->SHPData['parts']);
                $result = 22 + 2 * $count;
                for ($i = 0; $i < $count; ++$i) {
                    $result += 8 * count($this->SHPData['parts'][$i]['points']);
                }
                break;
            case 23:
            case 25:
                $count = count($this->SHPData['parts']);
                $result = 22 + (2 * 4) + 2 * $count;
                for ($i = 0; $i < $count; ++$i) {
                    $result += (8 + 4) * count($this->SHPData['parts'][$i]['points']);
                }
                break;
            case 13:
            case 15:
                $count = count($this->SHPData['parts']);
                $result = 22 + (4 * 4) + 2 * $count;
                for ($i = 0; $i < $count; ++$i) {
                    $result += (8 + 8) * count($this->SHPData['parts'][$i]['points']);
                }
                break;
            case 8:
                $result = 20 + 8 * count($this->SHPData['points']);
                break;
            case 28:
                $result = 20 + (2 * 4) + (8 + 4) * count($this->SHPData['points']);
                break;
            case 18:
                $result = 20 + (4 * 4) + (8 + 8) * count($this->SHPData['points']);
                break;
            default:
                $result = false;
                $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType));
                break;
        }

        return $result;
    }
public function getContentLength ( ) { // The content length for a record is the length of the record contents section measured in 16-bit words. // one coordinate makes 4 16-bit words (64 bit double) switch ( $ this -> shapeType ) { case 0 : $ result = 0 ; break ; case 1 : $ result = 10 ; break ; case 21 : $ result = 10 + 4 ; break ; case 11 : $ result = 10 + 8 ; break ; case 3 : case 5 : $ count = count ( $ this -> SHPData [ 'parts' ] ) ; $ result = 22 + 2 * $ count ; for ( $ i = 0 ; $ i < $ count ; ++ $ i ) { $ result += 8 * count ( $ this -> SHPData [ 'parts' ] [ $ i ] [ 'points' ] ) ; } break ; case 23 : case 25 : $ count = count ( $ this -> SHPData [ 'parts' ] ) ; $ result = 22 + ( 2 * 4 ) + 2 * $ count ; for ( $ i = 0 ; $ i < $ count ; ++ $ i ) { $ result += ( 8 + 4 ) * count ( $ this -> SHPData [ 'parts' ] [ $ i ] [ 'points' ] ) ; } break ; case 13 : case 15 : $ count = count ( $ this -> SHPData [ 'parts' ] ) ; $ result = 22 + ( 4 * 4 ) + 2 * $ count ; for ( $ i = 0 ; $ i < $ count ; ++ $ i ) { $ result += ( 8 + 8 ) * count ( $ this -> SHPData [ 'parts' ] [ $ i ] [ 'points' ] ) ; } break ; case 8 : $ result = 20 + 8 * count ( $ this -> SHPData [ 'points' ] ) ; break ; case 28 : $ result = 20 + ( 2 * 4 ) + ( 8 + 4 ) * count ( $ this -> SHPData [ 'points' ] ) ; break ; case 18 : $ result = 20 + ( 4 * 4 ) + ( 8 + 8 ) * count ( $ this -> SHPData [ 'points' ] ) ; break ; default : $ result = false ; $ this -> setError ( sprintf ( 'The Shape Type "%s" is not supported.' , $ this -> shapeType ) ) ; break ; } return $ result ; }
Returns length of content.

@return int
Returns length of content .