ShapeFile
class ShapeFile (View source)
ShapeFile class.
Constants
MAGIC |
|
Properties
string | $lastError | ||
ShapeRecord> | $records |
Methods
Checks whether dbase manipulations are supported.
No description
No description
Loads shapefile and dbase (if supported).
Saves shapefile.
Deletes record from shapefile.
Returns array defining fields in DBF file.
Changes array defining fields in DBF file, used in dbase_create call.
Lookups value in the DBF file and returns index.
Sets error message.
Reads given number of bytes from SHP file.
Checks whether file is at EOF.
Returns shape name.
Check whether file contains measure data.
Details
static bool
supportsDbase()
Checks whether dbase manipulations are supported.
__construct(ShapeType $shapeType, array $boundingBox = ['xmin' => 0.0, 'ymin' => 0.0, 'xmax' => 0.0, 'ymax' => 0.0], string|null $fileName = null)
No description
void
setAllowNoDbf(bool $allowNoDbf)
No description
bool
loadFromFile(string $fileName)
Loads shapefile and dbase (if supported).
bool
saveToFile(string|null $fileName = null)
Saves shapefile.
int
addRecord(ShapeRecord $record)
Adds record to shape file.
void
deleteRecord(int $index)
Deletes record from shapefile.
array|null
getDBFHeader()
Returns array defining fields in DBF file.
void
setDBFHeader(array $header)
Changes array defining fields in DBF file, used in dbase_create call.
int
getIndexFromDBFData(string $field, string $value)
Lookups value in the DBF file and returns index.
void
setError(string $error)
Sets error message.
string|false
readSHP(int $bytes)
Reads given number of bytes from SHP file.
bool
eofSHP()
Checks whether file is at EOF.
string
getShapeName()
Returns shape name.
bool
hasMeasure()
Check whether file contains measure data.
For some reason this is distinguished by zero bounding box in the specification.