Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRID set to 0 for points in MySQL #52

Open
spackmat opened this issue Mar 19, 2015 · 7 comments
Open

SRID set to 0 for points in MySQL #52

spackmat opened this issue Mar 19, 2015 · 7 comments
Milestone

Comments

@spackmat
Copy link

Hi,

is it intended, that points are set with a SRID of 0 in MySQL (or maybe not set at all)?

When I save a new Point with a given SRID to the database, the SRID is always 0 afterwards.

Greets,
spackmat

@ddproxy
Copy link
Member

ddproxy commented Oct 15, 2015

@spackmat SRID is default to the specification of the database. There is an optional parameter after these methods (in postgis) that define the SRID if it's not set on the table already. There may also be a parameter to have the database warn/explode if no SRID is defined in the query - but I'm not our database administrator :S good luck

@djlambert
Copy link
Member

Currently the MySQL code doesn't use the SRID value. This is something that'll need to be implemented.

@ddproxy ddproxy added this to the 1.1 milestone Jan 26, 2016
@sadortun sadortun modified the milestones: 1.1, 1.2 Feb 25, 2016
@sadortun
Copy link
Member

#156

@yurtesen
Copy link

Is there any news about if this will ever be implemented for MySQL? I am also interested in this feature.

@sadortun
Copy link
Member

@yurtesen Your PR and contribution are most welcome ! The project is well used by many, i am sure many users will be happy to see SRID avalaibility !

@yurtesen
Copy link

yurtesen commented Nov 21, 2017

@sadotun I decided to use postgresql after all. The GIS functions in MySQL were just very limited. I made PR for postgresql. However I am not good at doing the test stuff. I hope somebody completes that part :) works for me...

@holtkamp
Copy link

holtkamp commented Jan 5, 2020

Note that without using proper SRID on columns, spatial indexes will not work on MySQL 8.x:

Added support for ST_SRID() which allows setting the SRID of a Point: ST_SRID(Point(:longitude, :latitude), :srid) to my branch: https://github.com/holtkamp/doctrine2-spatial/tree/mysql-80-support

@djlambert can you consider merging it using #196 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants