Doctrine2 multi-platform support for spatial types and functions. Currently MySQL and PostgreSQL with PostGIS are supported. Could potentially add support for other platforms if an interest is expressed.
This useful project was created by Derek J. Lambert. Alexandre Tranchant forked it from creof/doctrine2-spatial because project seems to be unactive since 2017.
The master release can be used, but be careful, the code coverage is false, and only 30% of spatial functions are tested. (Spatials Functions are only implemented with class containing only properties. So, they have zero code line and code coverage said they are fully covered, but it's false. To avoid this, all spatial functions are rebuild in OGC branch. This branch is under development
This fork will upgrade this package to the last doctrine version and the PHP supported versions. Developments are done under ogc branch because of backward incompatibility, we suggest to not use this fork for the moment. I would like to release the 2.0.0 version at the end of March.
Currently I'm searching help to configure Travis and configure PostgreSQL tests works on my dev environment but fails on Travis because of user connection. I'm searching ISO/IEC 13249-3:2016 documentation. I'm only working with OGC Standard
I will provide a lot of example, essentialy with a symfony project. Feel free to contribute!
Update your composer.json to add this package:
"require": {
....
"alexandret/doctrine2-spatial": "~1"
....
}
You will also have to change the version requirement of doctrine to the stable version 2.7:
"doctrine/orm": ">=2.7",
Doctrine dev version
Continuous integration tests libraries with 2.8.x-dev version. We try to be compatible with this version. Continuous integration tests libraries with 2.8.x-dev version. We *DO NOT try to be compatible with this version, currently. There is too much difference between interface declarations.
MySQL 5.7 and 8.0
A lot of functions change their names between this two versions. Currently, tests works with MySQL5.7 and failed with MySQL8.0, because function names have changed.
MariaDB 10
This version is not compatible with MariaDB version. Some spatial functions seems to work but their results are different from MySQL version (Contains function is a good example)
PostgreSQL