See Polygon _construct option $closed_rings for details Possible values are Shapefile::ACTION_IGNORE, Shapefile::ACTION_CHECK and Shapefile::ACTION_FORCE. They should be closed but some software don’t enforce that, creating uncompliant Shapefiles. Shapefile::OPTION_POLYGON_CLOSED_RINGS_ACTIONĭefines action to perform on Polygons rings. Ignores bounding box read from shapefile and computes a real one instead Ignores geometries bounding boxes read from shapefile and computes some real ones instead Shapefile::OPTION_IGNORE_GEOMETRIES_BBOXES This might not always work and random access to specific records will not be possible shx file (useful to recover corrupted Shapefiles). Data will not be available for geometries dbf file (useful to recover corrupted Shapefiles). Reads Polyline and Polygon Geometries as Multi (ESRI specs do not distinguish between Linestring/MultiLinestring and Polygon/MultiPolygon) Returns dates as DateTime objects instead of ISO strings ( YYYY-MM-DD) Shapefile::OPTION_DBF_RETURN_DATES_AS_OBJECTS Returns a null value for invalid dates when reading. Shapefile::OPTION_DBF_NULLIFY_INVALID_DATES dbf fileĭefines a null padding character used in the. dbf fileĪrray containing the names of the fields to ignore from the. dbf fileįorces all column names in upper case in the. dbf fileĬonverts from input charset to UTF-8 all strings read from the. Shapefile::OPTION_DBF_ALLOW_FIELD_SIZE_255Īllows a maximum field size of 255 bytes instead of 254 bytes in the. Here are the supported options and their default values: Option $Shapefile = new ShapefileReader ( 'myshape.shp', , ]) ▲ Back to Namespaces and Classes ShapefileException::getDetails Integer value overflows field size definition Shapefile::ERR_INPUT_NUMERIC_VALUE_OVERFLOW Geometry index not valid (check the total number of geometries in the collection) Shapefile::ERR_INPUT_GEOMETRY_INDEX_NOT_VALID Shapefile::ERR_INPUT_GEOMETRY_TYPE_NOT_VALID Record index not found (check the total number of records in the. shx file, only sequential read is possible Shapefile::ERR_INPUT_RANDOM_ACCESS_UNAVAILABLE Polygon orientation not compliant with Shapefile specifications Shapefile::ERR_GEOM_POLYGON_WRONG_ORIENTATION Geometry is missing a field defined in the ShapefileĪ Point can be either EMPTY or al least 2D Shapefile::ERR_GEOM_MISMATCHED_DIMENSIONSĪll geometries in a collection must have the same dimensions (2D, 3D or 4D)īounding box must have the same dimensions as the Geometry (2D, 3D or 4D) Shapefile::ERR_GEOM_COORD_VALUE_NOT_VALID Shapefile::ERR_DBF_FIELD_DECIMALS_NOT_VALIDįield decimals incorrect according to its typeĮrror during conversion from provided. dbf file reachedįield type must be CHAR, DATE, LOGICAL, MEMO or NUMERICįield size incorrect according to its type Shapefile::ERR_DBF_MAX_FIELD_COUNT_REACHEDĬannot add other fields, maximum number of fields in a. Number of records not corresponding to the. dbf file doesn’t seem to be a valid dBase III or dBase IV format Shapefile::ERR_SHP_FILE_ALREADY_INITIALIZEDĬannot change Shapefile definition after it has been initialized with data Geometry type must be compatible with Shapefile shape typeīounding box must have the same dimensions as the Shapefile (2D, 3D or 4D) Shapefile::ERR_SHP_GEOMETRY_TYPE_NOT_COMPATIBLE Useful to react to specific errors.Ĭheck if the file exists and is readable and/or writable Public ShapefileException :: getErrorType ( void ) : string ▲ Back to Namespaces and Classes ShapefileException::getErrorType It adds 2 custom methods getErrorType() and getDetails(). It can be used to isolate PHP Shapefile related exceptions. ▲ Back to Namespaces and Classes Class Shapefile\ShapefileExceptionĪ custom exception which extends PHP native Exception class. Use the static method Shapefile\ShapefileAutoloader::register() as shown in the example to register the PHP Shapefile autoloader. This is a simple static class which provides autoloading capabilities for the library. To keep things easy and tidy, all package-wide constants are exposed by Shapefile\ Shapefile Abstract Class, e.g.: Shapefile::OPTION_SUPPRESS_Z. There are 2 Namespaces, Shapefile and Shapefile\Geometry, containing the following Classes: Register autoloader require_once ( 'php-shapefile/src/Shapefile/ShapefileAutoloader.php' ) Shapefile\ShapefileAutoloader :: register () // Import classes use Shapefile\Shapefile use Shapefile\ShapefileException use Shapefile\ShapefileWriter use Shapefile\Geometry\Point try Ĭheck the Examples section for more usage hints.
0 Comments
Leave a Reply. |