class ShapeRecord (View source)

ShapeFile record class.

Properties

int|null $recordNumber
$shapeType
string $lastError
array $shpData
array $dbfData

Methods

__construct(int $shapeType)

No description

void
loadFromFile(ShapeFile $shapeFile, resource $shpFile, resource $dbfFile)

Loads record from files.

void
saveToFile(resource $shpFile, resource $dbfFile, int $recordNumber)

Saves record to files.

void
updateDBFInfo(array $header)

Updates DBF data to match header.

void
addPoint(array $point, int $partIndex = 0)

Adds point to a record.

void
deletePoint(int $pointIndex = 0, int $partIndex = 0)

Deletes point from a record.

int|null
getContentLength()

Returns length of content.

void
setError(string $error)

Sets error message.

string
getShapeName()

Returns shape name.

Details

__construct(int $shapeType)

Parameters

int $shapeType

void loadFromFile(ShapeFile $shapeFile, resource $shpFile, resource $dbfFile)

Loads record from files.

Parameters

ShapeFile $shapeFile The ShapeFile object
resource $shpFile Opened SHP file (by reference)
resource $dbfFile Opened DBF file (by reference)

Return Value

void

void saveToFile(resource $shpFile, resource $dbfFile, int $recordNumber)

Saves record to files.

Parameters

resource $shpFile Opened SHP file
resource $dbfFile Opened DBF file
int $recordNumber Record number

Return Value

void

void updateDBFInfo(array $header)

Updates DBF data to match header.

Parameters

array $header DBF structure header

Return Value

void

void addPoint(array $point, int $partIndex = 0)

Adds point to a record.

Parameters

array $point Point data
int $partIndex Part index

Return Value

void

void deletePoint(int $pointIndex = 0, int $partIndex = 0)

Deletes point from a record.

Parameters

int $pointIndex Point index
int $partIndex Part index

Return Value

void

int|null getContentLength()

Returns length of content.

Return Value

int|null

void setError(string $error)

Sets error message.

Parameters

string $error

Return Value

void

string getShapeName()

Returns shape name.

Return Value

string