class ShapeRecord (View source)

ShapeFile record class.

Properties

int $recordNumber
string $lastError
array $shpData
array $dbfData

Methods

__construct(ShapeType $shapeType)

No description

void
loadFromFile(ShapeFile $shapeFile, resource|false $dbfFile)

Loads record from files.

void
saveToFile(resource $shpFile, resource|false $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(ShapeType $shapeType)

No description

Parameters

ShapeType $shapeType

void loadFromFile(ShapeFile $shapeFile, resource|false $dbfFile)

Loads record from files.

Parameters

ShapeFile $shapeFile

The ShapeFile object

resource|false $dbfFile

Opened DBF file

Return Value

void

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

Saves record to files.

Parameters

resource $shpFile

Opened SHP file

resource|false $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