Releases: gasparesganga/php-shapefile
Releases · gasparesganga/php-shapefile
v3.4.1
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
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
v3.3.2
v3.3.1
Fixed
- Prevented a PHP warning when encoding a boolean
false
value for aShapefile::DBF_TYPE_LOGICAL
field
See release notes
v3.3.0
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
andShapefile\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
andShapefile\Geometry\MultiPolygon
constructor parameter$flag_enforce_closed_rings
is now$closed_rings
and acceptsShapefile::ACTION_IGNORE
,Shapefile::ACTION_CHECK
andShapefile::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
. UseShapefile::OPTION_POLYGON_CLOSED_RINGS_ACTION
instead.Shapefile::OPTION_INVERT_POLYGONS_ORIENTATION
. UseShapefile::OPTION_POLYGON_OUTPUT_ORIENTATION
instead.
- Constants:
Shapefile::ERR_GEOM_POLYGON_AREA_TOO_SMALL
. UseShapefile::ERR_GEOM_RING_AREA_TOO_SMALL
instead.Shapefile::ERR_GEOM_POLYGON_NOT_VALID
. UseShapefile::ERR_GEOM_POLYGON_WRONG_ORIENTATION
instead.
See release notes
v3.2.0
Added
Shapefile::OPTION_DBF_ALLOW_FIELD_SIZE_255
constructor option for bothShapefileReader
andShapefileWriter
classes
See release notes
v3.1.3
Fixed
- Changed
GEOJSON_BASETYPE
constants forShapefile\Geometry\Linestring
andShapefile\Geometry\MultiLinestring
respectively to'LineString'
and'MultiLineString'
(with a capital S)
See release notes
v3.1.2
Fixed
- Do not apply
Shapefile::OPTION_FORCE_MULTIPART_GEOMETRIES
to Point Shapefiles
See release notes
v3.1.1
Fixed
- Truncate PRJ and CPG files before writing them to prevent content to be appended when
Shapefile::OPTION_EXISTING_FILES_MODE
is set toShapefile::MODE_APPEND
- Increased maximum number of fields in DBF files to 255
See release notes