longitude-one / doctrine-spatial

Doctrine extension to persist spatial data objects.
https://lo-doctrine-spatial.readthedocs.io/en/latest/
MIT License
67 stars 21 forks source link

SRID POINT Mysql 8+ Not saved #17

Open tebaly opened 3 years ago

tebaly commented 3 years ago

Mysql 8 can save PONT like this: ST_SRID(POINT(...), 4326) But

            $point = new Point($lon, $lat);
            $point->setSrid(4326); # !!!!!!!!!!
            $entity->setPoint($point);

Not working - SRID did not saved

Alexandre-T commented 3 years ago

Hello,

Currently the MySQL code doesn't use the SRID value. This is something that'll need to be implemented. Currently SRID are saved, but they aren't persisted.

We have to enhance the convertToDatabaseValueSQL in the MySQL classes for the Geographic types, but if someone wants to contribute, he should be careful and check the MySQL functionalities, because I remember that it wasn't compliant with first versions of MySQL5. I even don't know if SRID are now compliant with MySQL5.*