yii2-jquery-locationpicker
yii2-jquery-locationpicker copied to clipboard
Wrong sequence of latitude, longitude in mysql Point()
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.
I will check this sample code, sorry. Of course, you can switch to the first longitude, the second latitude, if this result is correct.
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.