brick/geo
GIS geometry library
0.13.1
1.7M downloads/mo
#1632 most downloaded on Packagist
brick/geo
What this package is like to depend on
Last release 1 years ago
20 Mar 2025
Release timing varies
gaps range from 2 weeks to 1.2 years
Nearly every release is documented
notes for 31 of 31 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
31 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
31 releases · Oct 2017 to Mar 2025Releases
latest 31-
0.13.120 Mar 2025Release notes
Open source →🐛 Bug fixes
- Uninitialized proxies would be broken when calling
withRoundedCoordinates() with*()proxy methods using variadic parameters were broken
Release notes
Open source →🐛 Bug fixes
- Uninitialized proxies would be broken when calling
withRoundedCoordinates() with*()proxy methods using variadic parameters were broken
- Uninitialized proxies would be broken when calling
-
0.13.017 Mar 2025Release notes
Open source →💥 Breaking changes
The case of the following class names and namespaces has changed:
GEOSEngine=>GeosEnginePDOEngine=>PdoEngineSQLite3Engine=>Sqlite3EngineRemoveZMProjector=>RemoveZmProjectorSRIDProjector=>SridProjectorSwapXYProjector=>SwapXyProjectorTIN=>TinGeometryIOException=>GeometryIoExceptionIO\EWKBReader=>Io\EwkbReaderIO\EWKBWriter=>Io\EwkbWriterIO\EWKTReader=>Io\EwktReaderIO\EWKTWriter=>Io\EwktWriterIO\WKBReader=>Io\WkbReaderIO\WKBWriter=>Io\WkbWriterIO\WKTReader=>Io\WktReaderIO\WKTWriter=>Io\WktWriterIO\GeoJSONReader=>Io\GeoJsonReaderIO\GeoJSONWriter=>Io\GeoJsonWriterIO\GeoJSON\Feature=>Io\GeoJson\FeatureIO\GeoJSON\FeatureCollection=>Io\GeoJson\FeatureCollection
The following breaking changes will only affect you if you're writing your own geometry engine:
GeometryEngineinterface has a new method:concaveHull()DatabaseEngine::executeQuery()implementations must now acceptboolparametersDatabaseEngine::getParameterPlaceholder()signature has changed to acceptboolparametersDatabaseEngine::queryGeometry()is nowfinal
The following breaking changes may only affect you if you're writing your own engine or geometry classes:
GeometryExceptionconstructor signature has changedGeometryhas a new method:withRoundedCoordinates()
✨ New features
- New geometry engine:
GeosOpEngineuses thegeosopbinary to perform geometry operations - New engine method:
GeometryEngine::concaveHull() - New
Geometrymethod:withRoundedCoordinates()
✨ Improvements
- All
GeometryEnginemethods are now properly documented with@throws GeometryEngineException
🐛 Bug fixes
WktParserandEwktParsernow accept bothMULTIPOINT (1 2, 3 4)andMULTIPOINT((1 2), (3 4))syntaxes;
this notably fixes interoperability issues with PostGIS
Release notes
Open source →💥 Breaking changes
The case of the following class names and namespaces has changed:
GEOSEngine=>GeosEnginePDOEngine=>PdoEngineSQLite3Engine=>Sqlite3EngineRemoveZMProjector=>RemoveZmProjectorSRIDProjector=>SridProjectorSwapXYProjector=>SwapXyProjectorTIN=>TinGeometryIOException=>GeometryIoExceptionIO\EWKBReader=>Io\EwkbReaderIO\EWKBWriter=>Io\EwkbWriterIO\EWKTReader=>Io\EwktReaderIO\EWKTWriter=>Io\EwktWriterIO\WKBReader=>Io\WkbReaderIO\WKBWriter=>Io\WkbWriterIO\WKTReader=>Io\WktReaderIO\WKTWriter=>Io\WktWriterIO\GeoJSONReader=>Io\GeoJsonReaderIO\GeoJSONWriter=>Io\GeoJsonWriterIO\GeoJSON\Feature=>Io\GeoJson\FeatureIO\GeoJSON\FeatureCollection=>Io\GeoJson\FeatureCollection
The following breaking changes will only affect you if you're writing your own geometry engine:
GeometryEngineinterface has a new method:concaveHull()DatabaseEngine::executeQuery()implementations must now acceptboolparametersDatabaseEngine::getParameterPlaceholder()signature has changed to acceptboolparametersDatabaseEngine::queryGeometry()is nowfinal
The following breaking changes may only affect you if you're writing your own engine or geometry classes:
GeometryExceptionconstructor signature has changedGeometryhas a new method:withRoundedCoordinates()
✨ New features
- New geometry engine:
GeosOpEngineuses thegeosopbinary to perform geometry operations - New engine method:
GeometryEngine::concaveHull() - New
Geometrymethod:withRoundedCoordinates()
✨ Improvements
- All
GeometryEnginemethods are now properly documented with@throws GeometryEngineException
🐛 Bug fixes
WktParserandEwktParsernow accept bothMULTIPOINT (1 2, 3 4)andMULTIPOINT((1 2), (3 4))syntaxes; this notably fixes interoperability issues with PostGIS
-
0.12.009 Mar 2025Release notes
Open source →💥 Breaking changes
- Interface
GeometryEnginehas 2 new methods:lineInterpolatePoint(),lineInterpolatePoints() BoundingBox's constructor is now private, useBoundingBox::new()to create a new instanceCompoundCurvecan now only containLineStringandCircularStringinstances; nestedCompoundCurveinstances are forbiddenGeometryno longer implementsCountableandIteratorAggregate; subclasses implement these interfaces as needed, with proper types- The
SQLite3Exceptionclass has been removed - The
GeometryEngineException::operationNotSupportedByEngine()method has been removed - The following classes are now
final:BoundingBoxCoordinateSystem- engines:
GEOSEnginePDOEngineSQLite3Engine
- exceptions:
CoordinateSystemExceptionEmptyGeometryExceptionGeometryEngineExceptionGeometryIOExceptionInvalidGeometryExceptionNoSuchGeometryExceptionUnexpectedGeometryException
- input/output:
EWKBReaderEWKBWriterEWKTReaderEWKTWriterGeoJSONReaderGeoJSONWriterWKBReaderWKBWriterWKTReaderWKTWriter
- The following classes are marked as
@internal, and are no longer part of the public API:Attribute\NoProxyEngine\GeometryParameterIO\AbstractWKBReaderIO\AbstractWKBWriterIO\AbstractWKTReaderIO\AbstractWKTWriterIO\EWKBToolsIO\EWKTParserIO\WKBBufferIO\WKBByteOrderIO\WKBGeometryHeaderIO\WKBToolsIO\WKTParser
🗑️ Deprecations
- The following classes are marked as
@final, and will be made final in a future version:CircularStringCompoundCurveCurvePolygonLineStringMultiLineStringMultiPointMultiPolygonPointTINTriangle
✨ New features
- New engine methods:
GeometryEngine::lineInterpolatePoint(),lineInterpolatePoints()(#55 by @arminwinkt)
✨ Improvements
- Improved documentation and return types for
Geometry::toArray()methods PDOEngineandSQLite3Enginenow wrap all underlying exceptions in aGeometryEngineException- When an engine exception occurs,
GeometryEngineExceptionnow includes the original exception message
Release notes
Open source →💥 Breaking changes
- Interface
GeometryEnginehas 2 new methods:lineInterpolatePoint(),lineInterpolatePoints() BoundingBox's constructor is now private, useBoundingBox::new()to create a new instanceCompoundCurvecan now only containLineStringandCircularStringinstances; nestedCompoundCurveinstances are forbiddenGeometryno longer implementsCountableandIteratorAggregate; subclasses implement these interfaces as needed, with proper types- The
SQLite3Exceptionclass has been removed - The
GeometryEngineException::operationNotSupportedByEngine()method has been removed - The following classes are now
final:BoundingBoxCoordinateSystem- engines:
GEOSEnginePDOEngineSQLite3Engine
- exceptions:
CoordinateSystemExceptionEmptyGeometryExceptionGeometryEngineExceptionGeometryIOExceptionInvalidGeometryExceptionNoSuchGeometryExceptionUnexpectedGeometryException
- input/output:
EWKBReaderEWKBWriterEWKTReaderEWKTWriterGeoJSONReaderGeoJSONWriterWKBReaderWKBWriterWKTReaderWKTWriter
- The following classes are marked as
@internal, and are no longer part of the public API:Attribute\NoProxyEngine\GeometryParameterIO\AbstractWKBReaderIO\AbstractWKBWriterIO\AbstractWKTReaderIO\AbstractWKTWriterIO\EWKBToolsIO\EWKTParserIO\WKBBufferIO\WKBByteOrderIO\WKBGeometryHeaderIO\WKBToolsIO\WKTParser
🗑️ Deprecations
- The following classes are marked as
@final, and will be made final in a future version:CircularStringCompoundCurveCurvePolygonLineStringMultiLineStringMultiPointMultiPolygonPointTINTriangle
✨ New features
- New engine methods:
GeometryEngine::lineInterpolatePoint(),lineInterpolatePoints()(#55 by @arminwinkt)
✨ Improvements
- Improved documentation and return types for
Geometry::toArray()methods PDOEngineandSQLite3Enginenow wrap all underlying exceptions in aGeometryEngineException- When an engine exception occurs,
GeometryEngineExceptionnow includes the original exception message
- Interface
-
0.11.506 Mar 2025Release notes
Open source →🐛 Bug fixes
- The error mode of the PDO connection in
PDOEnginecould be left modified when an exception occurs - Uninitialized proxies would be broken when calling
with*()methods
Release notes
Open source →🐛 Bug fixes
- The error mode of the PDO connection in
PDOEnginecould be left modified when an exception occurs - Uninitialized proxies would be broken when calling
with*()methods
- The error mode of the PDO connection in
-
0.11.403 Mar 2025Release notes
Open source →🐛 Bug fixes
GeoJSONWritererroneously refused to writeMultiPoint,MultiLineStringandMultiPolygonnested insideGeometryCollection(#53)
✨ New features
GeoJSONWriterconstructor now has a$lenientflag to allow nestedGeometryCollectionobjects
✨ Improvements
- Improved exception messages in non-lenient mode in
GeoJSONReader - Performance improvement in
GeoJSONWriterwhen thebboxattribute is not requested
Release notes
Open source →🐛 Bug fixes
GeoJSONWritererroneously refused to writeMultiPoint,MultiLineStringandMultiPolygonnested insideGeometryCollection(#53)
✨ New features
GeoJSONWriterconstructor now has a$lenientflag to allow nestedGeometryCollectionobjects
✨ Improvements
- Improved exception messages in non-lenient mode in
GeoJSONReader - Performance improvement in
GeoJSONWriterwhen thebboxattribute is not requested
-
0.11.319 Feb 2025Release notes
Open source →✨ New features
- The following methods have been added:
CircularString::withAddedPoints()CompoundCurve::withAddedCurves()CurvePolygon::withExteriorRing(),withInteriorRings(),withAddedInteriorRings()GeometryCollection::withAddedGeometries()LineString::withAddedPoints()Polygon::withExteriorRing(),withInteriorRings(),withAddedInteriorRings()PolyhedralSurface::withAddedPatches()
Release notes
Open source →✨ New features
- The following methods have been added:
CircularString::withAddedPoints()CompoundCurve::withAddedCurves()CurvePolygon::withExteriorRing(),withInteriorRings(),withAddedInteriorRings()GeometryCollection::withAddedGeometries()LineString::withAddedPoints()Polygon::withExteriorRing(),withInteriorRings(),withAddedInteriorRings()PolyhedralSurface::withAddedPatches()
- The following methods have been added:
-
0.11.218 Feb 2025Release notes
Open source →🐛 Bug fixes
- extending an empty
BoundingBoxwould get its immutability violated by setting a coordinate system
Release notes
Open source →🐛 Bug fixes
- extending an empty
BoundingBoxwould get its immutability violated by setting a coordinate system
- extending an empty
-
0.11.119 Aug 2024 -
0.11.007 Jun 2024Release notes
Open source →💥 Breaking changes
- interface
GeometryEnginehas a new method:split() - method
GeometryEngine::boundingPolygons()has been removed
✨ New features
- New engine method:
GeometryEngine::split()
Release notes
Open source →💥 Breaking changes
- interface
GeometryEnginehas a new method:split() - method
GeometryEngine::boundingPolygons()has been removed
✨ New features
- New engine method:
GeometryEngine::split()
- interface
-
0.10.023 Jan 2024Release notes
Open source →💥 Breaking changes
- Minimum PHP version is now
8.1 - interface
GeometryEnginehas a new method:makeValid() AbstractWKBWriter::setByteOrder()now accepts aWKBByteOrderenum instead of aWKBTools::*_ENDIANconstant- constants
WKBTools::BIG_ENDIANandWKBTools::LITTLE_ENDIANhave been removed - method
WKBTools::checkByteOrder()has been removed
✨ New features
- New engine method:
GeometryEngine::makeValid()
Release notes
Open source →💥 Breaking changes
- Minimum PHP version is now
8.1 - interface
GeometryEnginehas a new method:makeValid() AbstractWKBWriter::setByteOrder()now accepts aWKBByteOrderenum instead of aWKBTools::*_ENDIANconstant- constants
WKBTools::BIG_ENDIANandWKBTools::LITTLE_ENDIANhave been removed - method
WKBTools::checkByteOrder()has been removed
✨ New features
- New engine method:
GeometryEngine::makeValid()
- Minimum PHP version is now
-
0.9.021 Nov 2022Release notes
Open source →💥 Breaking changes
- Proxies are now
@internaland considered an implementation detail. This means that they are no longer part of the public API and can change at any time. This means that you should always type-hint against the base class and not the proxy. Pointconstructor now throws an exception when passingNaNor infinite coordinates.GeometryEngine::pointOnSurface()now returnsPointinstead ofGeometry.
🐛 Bug fixes
Geometry::withSRID()now properly propagates the SRID to all sub-geometries. Previously, only the top-level geometry was updated.Pointconstructor would error when destructuring an associative array.
✨ New features
- New
ProjectorAPI to reproject geometry coordinates. - New method:
Polygon::rings() - New method:
Geometry::isIdenticalTo()
✨ Improvements
GeometryCollection::geometryN()is now properly documented with generics.
- Proxies are now
-
0.8.114 Oct 2022Release notes
Open source →✨ Improvements
- Better Psalm annotations for geometry getters
- Removed outdated suggestion in
composer.json - Minor documentation fixes & proxy code style improvements
-
0.8.010 Oct 2022Release notes
Open source →💥 Breaking changes
Minimum PHP version is now
8.0.The global
GeometryEngineRegistryis gone. All convenience methods that rely on theGeometryEngineRegistryhave been removed. You should now explicitly call theGeometryEngine, that you can get injected with your dependency injection container.For example, the following call:
$lineString->length();Should be replaced with:
$geometryEngine->length($lineString);Detail of breaking changes
The following class has been removed:
GeometryEngineRegistry
The following method has been added:
GeometryEngine::isRing()
The following method signatures have been changed:
GeometryEngine::boundingPolygons()
The following deprecated methods have been removed:
Curve::isClosed()Curve::isRing()Curve::length()Geometry::boundary()Geometry::buffer()Geometry::centroid()Geometry::contains()Geometry::convexHull()Geometry::crosses()Geometry::difference()Geometry::disjoint()Geometry::distance()Geometry::equals()Geometry::envelope()Geometry::intersection()Geometry::intersects()Geometry::isSimple()Geometry::isValid()Geometry::locateAlong()Geometry::locateBetween()Geometry::maxDistance()Geometry::overlaps()Geometry::relate()Geometry::simplify()Geometry::snapToGrid()Geometry::symDifference()Geometry::touches()Geometry::transform()Geometry::union()Geometry::within()MultiCurve::isClosed()MultiCurve::length()MultiSurface::area()MultiSurface::pointOnSurface()Point::azimuth()PolyhedralSurface::boundingPolygons()PolyhedralSurface::isClosed()Surface::area()Surface::pointOnSurface()
The following change only affects you if you implement a custom
DatabaseEngine:- The signature of
DatabaseEngine::getParameterPlaceholder()has changed
💥 Non-breaking changes
- The following signatures have changed, but are not a breaking change due to LSP:
DatabaseEngine::getParameterPlaceholder(mixed $parameter): stringGeometryEngine::length(Curve|MultiCurve $g): floatGeometryEngine::area(Surface|MultiSurface $g): floatGeometryEngine::pointOnSurface(Surface|MultiSurface $g): Geometry
🐛 Fixes
- Fixed a potential bug when destructuring associative arrays in Geometry class constructors
-
0.7.209 Oct 2022Release notes
Open source →🗑️ Deprecations
The
GeometryEngineRegistryclass has been deprecated. All convenience methods on Geometry classes that rely on theGeometryEngineRegistryare deprecated, and will be removed in version0.8.You should now explicitly call the
GeometryEngine, that you can get injected with your dependency injection container.Deprecated methods:
Curve::isClosed()Curve::isRing()Curve::length()Geometry::boundary()Geometry::buffer()Geometry::centroid()Geometry::contains()Geometry::convexHull()Geometry::crosses()Geometry::difference()Geometry::disjoint()Geometry::distance()Geometry::equals()Geometry::envelope()Geometry::intersection()Geometry::intersects()Geometry::isSimple()Geometry::isValid()Geometry::locateAlong()Geometry::locateBetween()Geometry::maxDistance()Geometry::overlaps()Geometry::relate()Geometry::simplify()Geometry::snapToGrid()Geometry::symDifference()Geometry::touches()Geometry::transform()Geometry::union()Geometry::within()MultiCurve::isClosed()MultiCurve::length()MultiSurface::area()MultiSurface::pointOnSurface()Point::azimuth()PolyhedralSurface::boundingPolygons()PolyhedralSurface::isClosed()Surface::area()Surface::pointOnSurface()
-
0.7.106 Nov 2021 -
0.7.010 Oct 2021Release notes
Open source →💥 Breaking change
The Doctrine mapping types & functions have been moved to a separate package.
If you don't use these, you don't need to do anything to upgrade. If you use them, just require the brick/geo-doctrine package in addition to
brick/geo. -
0.6.217 Aug 2021Release notes
Open source →🐛 Fixes
- Fixed bug when retrieving
GeometryCollectionon MySQL 8 usingDatabaseEngine(#33)
- Fixed bug when retrieving
-
0.6.120 Apr 2021Release notes
Open source →🐛 Fixes
- Fixed bug with PDO MySQL when using non-emulated prepared statements
-
0.6.016 Mar 2021Release notes
Open source →✨ New features
- Proper support for
FeatureandFeatureCollectioninGeoJSONReaderandGeoJSONWriter - Support for auto-calculating the
bboxattribute inGeoJSONWriter - New method:
Geometry::transform()transformsGeometrycoordinates to a new SRID - New method:
Geometry::toXY()returns a newGeometrywith noZandMcoordinates - New method:
Geometry::withoutZ()returns a newGeometrywith theZcoordinate removed - New method:
Geometry::withoutM()returns a newGeometrywith theMcoordinate removed - New method:
Geometry::getBoundingBox()returns the south-west and north-east bounds of a Geometry - New method:
CoordinateSystem::isEqualTo()compares against anotherCoordinateSystem
🐛 Fixes
- Doctrine types could hydrate a parent Geometry proxy class, but now hydrate the correct Geometry proxy subclass by introspecting the WKB without fully loading it
✨ Improvements
- Proxy data is now always sent as is to the
DatabaseEngine
💥 BC breaks
- Minimum PHP version is now 7.4
- New signature for
CoordinateSystemException::sridMix() - New signature for
CoordinateSystemException::dimensionalityMix()
The following breaks only affect you if you use the GeoJSON reader/writer:
GeoJSONReadernow instantiates Features and FeatureCollections asFeatureandFeatureCollectionobjects, instead ofGeometryandGeometryCollectionobjectsGeoJSONWriterwill now write GeometryCollections asGeometryCollectiontype, instead ofFeatureCollection
The following breaks will only affect you if you're writing your own geometry engine, or your own WKB reader:
AbstractWKBReader::readGeometryHeader()signature was changedWKBReader::read()signature was changedGeometryEnginehas a newtransform()methodProxyInterfacehas a newisProxyBinary()method
- Proper support for
-
0.5.120 Apr 2021Release notes
Open source →🐛 Fixes
- Fixed bug with PDO MySQL when using non-emulated prepared statements
-
0.5.005 Mar 2021Release notes
Open source →🐛 Fixes
- Fixed illegal parameter data type issue on MariaDB
💥 BC breaks
Note: these breaks will likely not affect you, unless you're writing your own geometry engine.
DatabaseEngine::$useProxyis nowprivate, and must be provided through a parent constructor call.DatabaseEngine::executeQuery(), when provided with geometry data, now takesGeometryParameterobjects instead ofGeometryobjects directly.
-
0.4.029 Dec 2020Release notes
Open source →✨ New features
- New method
Point::azimuth()(#17) thanks to @Kolyunya centroid()is now available on the rootGeometryclass (#20) thanks to @Kolyunya- Psalm annotations on the whole codebase
🐛 Fixes
- Fixed wrongly documented return types
💥 BC breaks
Note: these breaks will likely not affect you, unless you're writing your own geometry engine or WK(B|T) parser.
GeometryEngineinterface adds anazimuth()methodGeometryEngine::centroid()now returnsPoint- constants in
WKTParser/EWKTParserare nowprotected WBKBuffer::readDoubles()'s$countparameter is now typed
- New method
-
0.3.014 Dec 2020Release notes
Open source →✨ New features
- compatibility with PHP 8
- compatibility with brick/reflection
0.4
💥 Breaking changes
- minimum PHP version is now 7.2
- deprecated Doctrine function
EarthDistanceFunctionhas been removed
Earth distance calculations should be delegated to the geometry engine, that should be able to handle geographic computations; MySQL 8, for example, supports calculating distances in meters between two SRID 4326 points.
-
0.2.624 Dec 2019Release notes
Open source →Deprecations
Doctrine function
EarthDistanceFunctionis now deprecated, and will be removed in0.3.0.Improvements
This version extends compatibility to
brick/reflectionversion0.3. -
0.2.530 Mar 2019Release notes
Open source →New methods
Geometry::withSRID()CoordinateSystem::withSRID()
These methods return a copy of the original object, with the SRID altered.
-
0.2.430 Mar 2019Release notes
Open source →New method:
Geometry::swapXY()This methods returns a copy of the Geometry, with X and Y coordinates swapped. It is useful when needing to convert geometries from
Lat, LngtoLng, Latand conversely. -
0.2.326 Jan 2019Release notes
Open source →Improvements to GeoJSON reader and writer classes:
GeoJSONReadercan now be lenient with documents containing wrong case types, such asPOINTinstead ofPoint:
$reader = new GeoJSONReader(true); // case-insensitiveGeoJSONWritercan now pretty-print the JSON output:
$writer = new GeoJSONWriter(true); // pretty-print -
0.2.224 Jan 2019Release notes
Open source →This version adds support for importing from and exporting to GeoJSON:
Brick\Geo\IO\GeoJSONReaderBrick\Geo\IO\GeoJSONWriter
Thanks @michaelcurry 👍
-
0.2.107 Nov 2017Release notes
Open source →Fixed a potential Error when an Exception is expected in
WKBReaderandEWKBReader. -
0.2.003 Oct 2017 -
0.1.003 Oct 2017