Skip to content

v3.0.0

Choose a tag to compare

@gasparesganga gasparesganga released this 30 Aug 09:33
· 60 commits to master since this release

See v3 RELEASE NOTES

Added

  • Complete OOP style refactoring
  • Shapefile writing capabilities
  • PHPDoc style comments
  • Shapefile\Geometry namespace with Point, MultiPoint, Linestring, MultiLinestring, Polygon and MultiPolygon classes
  • ShapefileReader and ShapefileWriter classes
  • Shapefile, Geometry and GeometryCollection abstract classes
  • Custom DBF charset support
  • Support for emulated null values in DBF files
  • Reading and writing optional DBT files (support for MEMO fields)
  • Reading and writing optional CPG files
  • ShapefileException::getDetails() method
  • Constructor options constants:
    • Shapefile::OPTION_CPG_ENABLE_FOR_DEFAULT_CHARSET
    • Shapefile::OPTION_DBF_CONVERT_TO_UTF8
    • Shapefile::OPTION_DBF_FORCE_ALL_CAPS
    • Shapefile::OPTION_DBF_IGNORED_FIELDS
    • Shapefile::OPTION_DBF_NULL_PADDING_CHAR
    • Shapefile::OPTION_DBF_NULLIFY_INVALID_DATES
    • Shapefile::OPTION_DBF_RETURN_DATES_AS_OBJECTS
    • Shapefile::OPTION_DELETE_EMPTY_FILES
    • Shapefile::OPTION_ENFORCE_GEOMETRY_DATA_STRUCTURE
    • Shapefile::OPTION_ENFORCE_POLYGON_CLOSED_RINGS
    • Shapefile::OPTION_FORCE_MULTIPART_GEOMETRIES
    • Shapefile::OPTION_IGNORE_GEOMETRIES_BBOXES
    • Shapefile::OPTION_IGNORE_SHAPEFILE_BBOX
    • Shapefile::OPTION_INVERT_POLYGONS_ORIENTATION
    • Shapefile::OPTION_OVERWRITE_EXISTING_FILES
    • Shapefile::OPTION_SUPPRESS_M
    • Shapefile::OPTION_SUPPRESS_Z
  • File types constants:
    • Shapefile::FILE_SHP
    • Shapefile::FILE_SHX
    • Shapefile::FILE_DBF
    • Shapefile::FILE_DBT
    • Shapefile::FILE_PRJ
    • Shapefile::FILE_CPG
  • Shape types constants:
    • Shapefile::SHAPE_TYPE_NULL
    • Shapefile::SHAPE_TYPE_POINT
    • Shapefile::SHAPE_TYPE_POLYLINE
    • Shapefile::SHAPE_TYPE_POLYGON
    • Shapefile::SHAPE_TYPE_MULTIPOINT
    • Shapefile::SHAPE_TYPE_POINTZ
    • Shapefile::SHAPE_TYPE_POLYLINEZ
    • Shapefile::SHAPE_TYPE_POLYGONZ
    • Shapefile::SHAPE_TYPE_MULTIPOINTZ
    • Shapefile::SHAPE_TYPE_POINTM
    • Shapefile::SHAPE_TYPE_POLYLINEM
    • Shapefile::SHAPE_TYPE_POLYGONM
    • Shapefile::SHAPE_TYPE_MULTIPOINTM
  • DBF fields types constants:
    • Shapefile::DBF_TYPE_CHAR
    • Shapefile::DBF_TYPE_DATE
    • Shapefile::DBF_TYPE_LOGICAL
    • Shapefile::DBF_TYPE_MEMO
    • Shapefile::DBF_TYPE_NUMERIC
    • Shapefile::DBF_TYPE_FLOAT
  • Error types constants:
    • Shapefile::ERR_UNDEFINED
    • Shapefile::ERR_FILE_MISSING
    • Shapefile::ERR_FILE_EXISTS
    • Shapefile::ERR_FILE_INVALID_RESOURCE
    • Shapefile::ERR_FILE_OPEN
    • Shapefile::ERR_FILE_READING
    • Shapefile::ERR_FILE_WRITING
    • Shapefile::ERR_SHP_TYPE_NOT_SUPPORTED
    • Shapefile::ERR_SHP_TYPE_NOT_SET
    • Shapefile::ERR_SHP_TYPE_ALREADY_SET
    • Shapefile::ERR_SHP_GEOMETRY_TYPE_NOT_COMPATIBLE
    • Shapefile::ERR_SHP_MISMATCHED_BBOX
    • Shapefile::ERR_SHP_FILE_ALREADY_INITIALIZED
    • Shapefile::ERR_SHP_WRONG_RECORD_TYPE
    • Shapefile::ERR_DBF_FILE_NOT_VALID
    • Shapefile::ERR_DBF_MISMATCHED_FILE
    • Shapefile::ERR_DBF_EOF_REACHED
    • Shapefile::ERR_DBF_MAX_FIELD_COUNT_REACHED
    • Shapefile::ERR_DBF_FIELD_NAME_NOT_UNIQUE
    • Shapefile::ERR_DBF_FIELD_NAME_NOT_VALID
    • Shapefile::ERR_DBF_FIELD_TYPE_NOT_VALID
    • Shapefile::ERR_DBF_FIELD_SIZE_NOT_VALID
    • Shapefile::ERR_DBF_FIELD_DECIMALS_NOT_VALID
    • Shapefile::ERR_DBF_CHARSET_CONVERSION
    • Shapefile::ERR_DBT_EOF_REACHED
    • Shapefile::ERR_GEOM_NOT_EMPTY
    • Shapefile::ERR_GEOM_COORD_VALUE_NOT_VALID
    • Shapefile::ERR_GEOM_MISMATCHED_DIMENSIONS
    • Shapefile::ERR_GEOM_MISMATCHED_BBOX
    • Shapefile::ERR_GEOM_MISSING_FIELD
    • Shapefile::ERR_GEOM_POINT_NOT_VALID
    • Shapefile::ERR_GEOM_POLYGON_OPEN_RING
    • Shapefile::ERR_GEOM_POLYGON_AREA_TOO_SMALL
    • Shapefile::ERR_GEOM_POLYGON_NOT_VALID
    • Shapefile::ERR_INPUT_RECORD_NOT_FOUND
    • Shapefile::ERR_INPUT_FIELD_NOT_FOUND
    • Shapefile::ERR_INPUT_GEOMETRY_TYPE_NOT_VALID
    • Shapefile::ERR_INPUT_GEOMETRY_INDEX_NOT_VALID
    • Shapefile::ERR_INPUT_ARRAY_NOT_VALID
    • Shapefile::ERR_INPUT_WKT_NOT_VALID
    • Shapefile::ERR_INPUT_GEOJSON_NOT_VALID
    • Shapefile::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 of utf8_encode() for charset conversion
  • ShapefileException::getErrorType() method returns one of Shapefile::ERR_* constant values
  • ShapefileReader::fetchRecord() method replaces ShapefileReader::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

  • ShapefileReader public methods:
    • setDefaultGeometryFormat()
    • readRecord()
  • ShapefileReader protected method init()
  • Shapefile constants:
    • Shapefile::FLAG_SUPPRESS_Z
    • Shapefile::FLAG_SUPPRESS_M
    • Shapefile::GEOMETRY_ARRAY
    • Shapefile::GEOMETRY_WKT
    • Shapefile::GEOMETRY_GEOJSON_GEOMETRY
    • Shapefile::GEOMETRY_GEOJSON_FEATURE
    • Shapefile::GEOMETRY_BOTH
  • Shapefile numeric error codes

See release notes