yii2-jquery-locationpicker icon indicating copy to clipboard operation
yii2-jquery-locationpicker copied to clipboard

Wrong sequence of latitude, longitude in mysql Point()

Open git-no opened this issue 6 years ago • 2 comments

Very nice documentation and code MYSQL-SPATIAL-CONVERSION.

Within the doc and example code the mySQL Point building is coded as:

point({$latitude},{$longitude})

Should it not be switched, first longitude, second latitude?

Reason: the mySQL documentation says "For Point objects that have a geographic spatial reference system (SRS), the longitude and latitude may be obtained " -> Point(x,y).

Positions transfered to a geographic system would by: x -> longitude y -> latitude This is simular to this stackoverflow article

So I assume mySQL Point() would expect something like this:

point({$longitude},{$latitude})

Or am I wrong? Thank you.

git-no avatar Jul 09 '18 17:07 git-no

I will check this sample code, sorry. Of course, you can switch to the first longitude, the second latitude, if this result is correct.

pigochu avatar Jul 10 '18 01:07 pigochu

Thank you for the quick response. I did so and also switched the sequence of the columns in the array related parts of the code.

git-no avatar Jul 10 '18 04:07 git-no