v3.0.0
See v3 RELEASE NOTES
Added
- Complete OOP style refactoring
- Shapefile writing capabilities
- PHPDoc style comments
Shapefile\Geometrynamespace withPoint,MultiPoint,Linestring,MultiLinestring,PolygonandMultiPolygonclassesShapefileReaderandShapefileWriterclassesShapefile,GeometryandGeometryCollectionabstract classes- Custom DBF charset support
- Support for emulated
nullvalues in DBF files - Reading and writing optional DBT files (support for
MEMOfields) - Reading and writing optional CPG files
ShapefileException::getDetails()method- Constructor options constants:
Shapefile::OPTION_CPG_ENABLE_FOR_DEFAULT_CHARSETShapefile::OPTION_DBF_CONVERT_TO_UTF8Shapefile::OPTION_DBF_FORCE_ALL_CAPSShapefile::OPTION_DBF_IGNORED_FIELDSShapefile::OPTION_DBF_NULL_PADDING_CHARShapefile::OPTION_DBF_NULLIFY_INVALID_DATESShapefile::OPTION_DBF_RETURN_DATES_AS_OBJECTSShapefile::OPTION_DELETE_EMPTY_FILESShapefile::OPTION_ENFORCE_GEOMETRY_DATA_STRUCTUREShapefile::OPTION_ENFORCE_POLYGON_CLOSED_RINGSShapefile::OPTION_FORCE_MULTIPART_GEOMETRIESShapefile::OPTION_IGNORE_GEOMETRIES_BBOXESShapefile::OPTION_IGNORE_SHAPEFILE_BBOXShapefile::OPTION_INVERT_POLYGONS_ORIENTATIONShapefile::OPTION_OVERWRITE_EXISTING_FILESShapefile::OPTION_SUPPRESS_MShapefile::OPTION_SUPPRESS_Z
- File types constants:
Shapefile::FILE_SHPShapefile::FILE_SHXShapefile::FILE_DBFShapefile::FILE_DBTShapefile::FILE_PRJShapefile::FILE_CPG
- Shape types constants:
Shapefile::SHAPE_TYPE_NULLShapefile::SHAPE_TYPE_POINTShapefile::SHAPE_TYPE_POLYLINEShapefile::SHAPE_TYPE_POLYGONShapefile::SHAPE_TYPE_MULTIPOINTShapefile::SHAPE_TYPE_POINTZShapefile::SHAPE_TYPE_POLYLINEZShapefile::SHAPE_TYPE_POLYGONZShapefile::SHAPE_TYPE_MULTIPOINTZShapefile::SHAPE_TYPE_POINTMShapefile::SHAPE_TYPE_POLYLINEMShapefile::SHAPE_TYPE_POLYGONMShapefile::SHAPE_TYPE_MULTIPOINTM
- DBF fields types constants:
Shapefile::DBF_TYPE_CHARShapefile::DBF_TYPE_DATEShapefile::DBF_TYPE_LOGICALShapefile::DBF_TYPE_MEMOShapefile::DBF_TYPE_NUMERICShapefile::DBF_TYPE_FLOAT
- Error types constants:
Shapefile::ERR_UNDEFINEDShapefile::ERR_FILE_MISSINGShapefile::ERR_FILE_EXISTSShapefile::ERR_FILE_INVALID_RESOURCEShapefile::ERR_FILE_OPENShapefile::ERR_FILE_READINGShapefile::ERR_FILE_WRITINGShapefile::ERR_SHP_TYPE_NOT_SUPPORTEDShapefile::ERR_SHP_TYPE_NOT_SETShapefile::ERR_SHP_TYPE_ALREADY_SETShapefile::ERR_SHP_GEOMETRY_TYPE_NOT_COMPATIBLEShapefile::ERR_SHP_MISMATCHED_BBOXShapefile::ERR_SHP_FILE_ALREADY_INITIALIZEDShapefile::ERR_SHP_WRONG_RECORD_TYPEShapefile::ERR_DBF_FILE_NOT_VALIDShapefile::ERR_DBF_MISMATCHED_FILEShapefile::ERR_DBF_EOF_REACHEDShapefile::ERR_DBF_MAX_FIELD_COUNT_REACHEDShapefile::ERR_DBF_FIELD_NAME_NOT_UNIQUEShapefile::ERR_DBF_FIELD_NAME_NOT_VALIDShapefile::ERR_DBF_FIELD_TYPE_NOT_VALIDShapefile::ERR_DBF_FIELD_SIZE_NOT_VALIDShapefile::ERR_DBF_FIELD_DECIMALS_NOT_VALIDShapefile::ERR_DBF_CHARSET_CONVERSIONShapefile::ERR_DBT_EOF_REACHEDShapefile::ERR_GEOM_NOT_EMPTYShapefile::ERR_GEOM_COORD_VALUE_NOT_VALIDShapefile::ERR_GEOM_MISMATCHED_DIMENSIONSShapefile::ERR_GEOM_MISMATCHED_BBOXShapefile::ERR_GEOM_MISSING_FIELDShapefile::ERR_GEOM_POINT_NOT_VALIDShapefile::ERR_GEOM_POLYGON_OPEN_RINGShapefile::ERR_GEOM_POLYGON_AREA_TOO_SMALLShapefile::ERR_GEOM_POLYGON_NOT_VALIDShapefile::ERR_INPUT_RECORD_NOT_FOUNDShapefile::ERR_INPUT_FIELD_NOT_FOUNDShapefile::ERR_INPUT_GEOMETRY_TYPE_NOT_VALIDShapefile::ERR_INPUT_GEOMETRY_INDEX_NOT_VALIDShapefile::ERR_INPUT_ARRAY_NOT_VALIDShapefile::ERR_INPUT_WKT_NOT_VALIDShapefile::ERR_INPUT_GEOJSON_NOT_VALIDShapefile::ERR_INPUT_NUMERIC_VALUE_OVERFLOW
Changed
- Folder structure under
src/reflects namespaces hierarchy - Namespace and class names case normalized
- Bitwise constructor flags replaced by associative array
- Default output polygons orientation is now opposite to ESRI Shapefile specs and compliant to OGC Simple Features
- Use of
iconv()instead ofutf8_encode()for charset conversion ShapefileException::getErrorType()method returns one ofShapefile::ERR_*constant valuesShapefileReader::fetchRecord()method replacesShapefileReader::getRecord()and returns an object- Order of bounding boxes associative arrays elements
Fixed
- Stricter invalid date format detection
- Logical (
bool) not initialized values (null) detection in DBF files
Removed
ShapefileReaderpublic methods:setDefaultGeometryFormat()readRecord()
ShapefileReaderprotected methodinit()Shapefileconstants:Shapefile::FLAG_SUPPRESS_ZShapefile::FLAG_SUPPRESS_MShapefile::GEOMETRY_ARRAYShapefile::GEOMETRY_WKTShapefile::GEOMETRY_GEOJSON_GEOMETRYShapefile::GEOMETRY_GEOJSON_FEATUREShapefile::GEOMETRY_BOTH
Shapefilenumeric error codes
See release notes