pigochu / yii2-jquery-locationpicker

jquery location picker widget for yii2
20 stars 7 forks source link

Wrong sequence of latitude, longitude in mysql Point() #26

Open git-no opened 6 years ago

git-no commented 6 years ago

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.

pigochu commented 6 years ago

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

git-no commented 6 years ago

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.