longitude-one / doctrine-spatial
Doctrine multi-platform support for spatial types and functions, compliant with Doctrine 2.19, 3.1, and dev ones (3.2 and 4.0).
Installs: 574 698
Dependents: 1
Suggesters: 0
Security: 0
Stars: 70
Watchers: 9
Forks: 21
Open Issues: 13
Requires
- php: ^8.1
- ext-json: *
- ext-mbstring: *
- doctrine/orm: ^2.19|^3.1
- longitude-one/geo-parser: ^3.0.1
- longitude-one/wkb-parser: ^3.0.0
- longitude-one/wkt-parser: ^3.0.0
Requires (Dev)
- cache/array-adapter: ^1.1
- dg/bypass-finals: ^1.3
- monolog/monolog: ^2.0
- phpunit/phpcov: ^9
- phpunit/phpunit: ^10.0
Replaces
This package is auto-updated.
Last update: 2024-12-17 18:26:58 UTC
README
Doctrine-spatial is a doctrine extension. It implements spatial types and functions. As exemple, this extension can help you to know if your favorite superheroes is inside Gotham city.
Currently, MySQL and PostgreSQL with PostGIS are supported. Could potentially add support for other platforms if an interest is expressed.
Current status
Documentation
The documentation explain how to:
- install this doctrine extension,
- configure this extension,
- create spatial entities,
- use spatial functions in your repositories,
- contribute (and test)
The documentation contains a glossary of all available types and all available spatial functions.
Project origins
This useful library was created by Derek J. Lambert. Alexandre Tranchant forked it from creof/doctrine-spatial because project seems to be non-active since 2017.
The longitude-one/doctrine-spatial repository employs a well-structured branching strategy:
- main: Stable 5.0 releases, bug fixes and minor new features (no backward incompatibilities).
- 6.0.x-dev: Major new features (potential backward incompatibilities).
- 5.1.x-dev: Controlled deprecations for a smooth 5.1 to 6.0 transition (no backward incompatibilities).
This approach ensures clarity, stability, and maintainability for the project.
Compatibility
PHP and Doctrine ORM
This Doctrine extension is compatible with PHP 8.1+ and Doctrine ORM versions ^2.9
, ^3.1
, and aims for continued compatibility with the upcoming major version ^4.x-dev
.
Security fixes will follow the PHP Roadmap.
MySQL 5.7 and 8.0
MySQL5.7 is supported, but is deprecated. MySQL8.0 is supported.
Known Limitation: longitude-one/doctrine-spatial
CANNOT store SRID on MySQL. Internally, this extension uses Well Known Text to convert internal types to database type. As doctrine/orm
does not allow custom persister nor collection persister, we cannot provide two parameters (WKT and SRID). Extented Well Known Text (EWKT) is used to convert internal types to databases but EWKT is only supported by Postgis. I'm trying a new solution: create an external Well Known Bytes converter to be able to use it convertToDatabaseValue
methods of doctrine/orm
and longitude-one/doctrine-spatial
.
PostgreSQL
This spatial library is compatible with PostgreSql. This library is tested with the last versions of Postgis and PostgreSql.
Help wanted
Microsoft SQL Server I'm searching help to create a docker delivering a Microsoft SQL Server service. So I'll be able to implement compatibility with this database server.
MariaDB I'm searching help to create a Github action delivering a MariaDB service, to launch test and determine if this library is compatible.