v3.1.0
Added
- Writing buffer in
ShapefileWriter. It allows up to a 50% reduction in writing time ShapefileWriter::flushBuffer()methodShapefile::OPTION_BUFFERED_RECORDSconstructor option forShapefileWriterclass- Capability to append records to existing Shapefiles
Shapefile::OPTION_EXISTING_FILES_MODEconstructor option forShapefileWriterclassShapefile::MODE_PRESERVE,Shapefile::MODE_APPEND,Shapefile::MODE_OVERWRITEconstantsisZ(),isM()andgetFieldsNames()methods for bothShapefileReaderandShapefileWriterclassesShapefileWriterexposegetShapeType(),getBoundingBox(),getPRJ(),getCharset(),setCharset(),getFieldsNames(),getField(),getFieldType(),getFieldSize(),getFieldDecimals(),getFields()andgetTotRecords()public methods likeShapefileReader- Sanitize and accept conflicting and duplicated field names
- Other minor code and performance improvements across the library
Changed
- Improved
GeometryCollection::getBoundingBox()method for better performance - Improved
ShapefileWriter::encodeFieldValue()method for better performance, relying on PHPnumber_format()for non-textual numeric input - Field name sanitization is always carried out in all
ShapefileWriterfield-adding methods Shapefile::ERR_DBF_FIELD_NAME_NOT_VALIDerror type is now defined as"Too many field names conflicting"- Default
c+bfile access mode forShapefileWriterclass
Fixed
- Convert field names to uppercase for
Geometrydata whenShapefile::OPTION_DBF_FORCE_ALL_CAPSis enabled - Decoupling field names sanitization and
Shapefile::OPTION_DBF_FORCE_ALL_CAPSoption Shapefile::ERR_GEOM_MISSING_FIELDexception was erroneously raised when a field had an explicitnullvalue andShapefile::OPTION_ENFORCE_GEOMETRY_DATA_STRUCTUREwas enabled- Suppress PHP warnings in
fread()andfwrite()calls: aShapefileExceptionis thrown anyways - Bug causing a corrupted DBF file when a
Shapefile::ERR_GEOM_MISSING_FIELDis raised - Bug causing wrong record number to be written in SHP record headers (count starts from
1, not from0) - Corner case bug affecting
ShapefileWriterdestructor when no record has been written yet
Removed
$flag_sanitize_nameparameter from all field-adding methodsShapefile::OPTION_OVERWRITE_EXISTING_FILESconstructor option forShapefileWriterclassShapefile::ERR_DBF_FIELD_NAME_NOT_UNIQUEerror type
See release notes