Skip to content

Releases: gasparesganga/php-shapefile

v3.4.1

29 Aug 12:14
Compare
Choose a tag to compare

Important notice

v3 branch will not receive any new features updates anymore. Only eventual bugfixes will be released for this branch. Legacy PHP users can safely keep using it, while PHP 8+ users should switch to v4 once it is released.

Fixed

  • ShapefileReader::rewind() pointer reset (thank you to Adrian Geissel for finding it)
  • Compatibility fixes for PHP 8+

See release notes

v3.4.0

23 Jan 08:25
Compare
Choose a tag to compare

Added

  • Full GeoJSON Feature support with properties data
  • Capability to ignore DBF and SHX files to recover corrupted Shapefiles
  • ShapefileReader constructor options constants:
    • Shapefile::OPTION_IGNORE_FILE_DBF
    • Shapefile::OPTION_IGNORE_FILE_SHX
  • ShapefileReader::getTotRecords() output constant:
    • Shapefile::UNKNOWN
  • Error types constants:
    • Shapefile::ERR_INPUT_RANDOM_ACCESS_UNAVAILABLE

Changed

  • Improved handling of Logical fields in DBF files
  • Increased tolerance coefficient to deal with extremely small areas when determining ring orientation

Fixed

  • Handling of unspecified bounding box in SHP and SHX file headers for empty Shapefiles
  • Behaviour with DBF files for empty Shapefiles

See release notes

v3.3.3

17 Sep 09:21
Compare
Choose a tag to compare

Fixed

  • Bug in ShapefileWriter::packPoint() method affecting Z and M geometries

See release notes

v3.3.2

17 Aug 14:19
Compare
Choose a tag to compare

Fixed

  • Removed duplicated doc block header from ShapefileWriter.php file

See release notes

v3.3.1

13 Aug 15:31
Compare
Choose a tag to compare

Fixed

  • Prevented a PHP warning when encoding a boolean false value for a Shapefile::DBF_TYPE_LOGICAL field

See release notes

v3.3.0

23 May 09:16
Compare
Choose a tag to compare

Added

  • Shapefile\Geometry\Linestring public methods:
    • Shapefile\Geometry\Linestring::isClockwise()
    • Shapefile\Geometry\Linestring::forceClockwise()
    • Shapefile\Geometry\Linestring::forceCounterClockwise()
    • Shapefile\Geometry\Linestring::forceClosedRing()
  • Shapefile\Geometry\Polygon public methods:
    • Shapefile\Geometry\Polygon::isClockwise()
    • Shapefile\Geometry\Polygon::isCounterClockwise()
    • Shapefile\Geometry\Polygon::forceClockwise()
    • Shapefile\Geometry\Polygon::forceCounterClockwise()
    • Shapefile\Geometry\Polygon::forceClosedRings()
  • Shapefile\Geometry\MultiPolygon public methods:
    • Shapefile\Geometry\MultiPolygon::isClockwise()
    • Shapefile\Geometry\MultiPolygon::isCounterClockwise()
    • Shapefile\Geometry\MultiPolygon::forceClockwise()
    • Shapefile\Geometry\MultiPolygon::forceCounterClockwise()
    • Shapefile\Geometry\MultiPolygon::forceClosedRings()
  • Shapefile\Geometry\GeometryCollection::reverseGeometries() protected method.
  • Shapefile\Geometry\Polygon and Shapefile\Geometry\MultiPolygon optional constructor parameter $force_orientation.
  • Shapefile\ShapefileReader constructor options:
    • Shapefile::OPTION_POLYGON_CLOSED_RINGS_ACTION
    • Shapefile::OPTION_POLYGON_ORIENTATION_READING_AUTOSENSE
    • Shapefile::OPTION_POLYGON_OUTPUT_ORIENTATION
  • Action constants:
    • Shapefile::ACTION_IGNORE
    • Shapefile::ACTION_CHECK
    • Shapefile::ACTION_FORCE
  • Polygon orientation constants:
    • Shapefile::ORIENTATION_CLOCKWISE
    • Shapefile::ORIENTATION_COUNTERCLOCKWISE
    • Shapefile::ORIENTATION_UNCHANGED
  • Error types constants:
    • Shapefile::ERR_GEOM_RING_AREA_TOO_SMALL
    • Shapefile::ERR_GEOM_RING_NOT_ENOUGH_VERTICES
  • Other constants:
    • Shapefile::UNDEFINED
  • Library implements a fluent interface that allows method chaining.

Changed

  • Shapefile\Geometry\Polygon and Shapefile\Geometry\MultiPolygon constructor parameter $flag_enforce_closed_rings is now $closed_rings and accepts Shapefile::ACTION_IGNORE, Shapefile::ACTION_CHECK and Shapefile::ACTION_FORCE values.
  • Code is now PSR-12 compliant

Deprecated

  • Shapefile\ShapefileReader constructor options that will disappear in the next releases:
    • Shapefile::OPTION_ENFORCE_POLYGON_CLOSED_RINGS. Use Shapefile::OPTION_POLYGON_CLOSED_RINGS_ACTION instead.
    • Shapefile::OPTION_INVERT_POLYGONS_ORIENTATION. Use Shapefile::OPTION_POLYGON_OUTPUT_ORIENTATION instead.
  • Constants:
    • Shapefile::ERR_GEOM_POLYGON_AREA_TOO_SMALL. Use Shapefile::ERR_GEOM_RING_AREA_TOO_SMALL instead.
    • Shapefile::ERR_GEOM_POLYGON_NOT_VALID. Use Shapefile::ERR_GEOM_POLYGON_WRONG_ORIENTATION instead.

See release notes

v3.2.0

09 Apr 18:04
Compare
Choose a tag to compare

Added

  • Shapefile::OPTION_DBF_ALLOW_FIELD_SIZE_255 constructor option for both ShapefileReader and ShapefileWriter classes

See release notes

v3.1.3

02 Feb 15:43
Compare
Choose a tag to compare

Fixed

  • Changed GEOJSON_BASETYPE constants for Shapefile\Geometry\Linestring and Shapefile\Geometry\MultiLinestring respectively to 'LineString' and 'MultiLineString' (with a capital S)

See release notes

v3.1.2

15 Jan 09:03
Compare
Choose a tag to compare

Fixed

  • Do not apply Shapefile::OPTION_FORCE_MULTIPART_GEOMETRIES to Point Shapefiles

See release notes

v3.1.1

10 Nov 07:04
Compare
Choose a tag to compare

Fixed

  • Truncate PRJ and CPG files before writing them to prevent content to be appended when Shapefile::OPTION_EXISTING_FILES_MODE is set to Shapefile::MODE_APPEND
  • Increased maximum number of fields in DBF files to 255

See release notes