Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/ShapeFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ class ShapeFile {

public $records;

/**
* @param integer $shapeType
*/
public function __construct($shapeType, $boundingBox = array("xmin" => 0.0, "ymin" => 0.0, "xmax" => 0.0, "ymax" => 0.0), $FileName = NULL) {
$this->shapeType = $shapeType;
$this->boundingBox = $boundingBox;
$this->FileName = $FileName;
$this->fileLength = 50; // The value for file length is the total length of the file in 16-bit words (including the fifty 16-bit words that make up the header).
}

/**
* @param string $FileName
*/
public function loadFromFile($FileName) {
$this->FileName = $FileName;

Expand All @@ -72,6 +78,9 @@ public function loadFromFile($FileName) {
}
}

/**
* @param string $FileName
*/
public function saveToFile($FileName = NULL) {
if ($FileName != NULL) {
$this->FileName = $FileName;
Expand All @@ -88,6 +97,9 @@ public function saveToFile($FileName = NULL) {
}
}

/**
* @param ShapeRecord $record
*/
public function addRecord($record) {
if ((isset($this->DBFHeader)) && (is_array($this->DBFHeader))) {
$record->updateDBFInfo($this->DBFHeader);
Expand Down Expand Up @@ -351,6 +363,9 @@ private function _closeDBFFile() {
}
}

/**
* @param string $error
*/
public function setError($error) {
$this->lastError = $error;
return false;
Expand Down