Latlong Data Type in SQL

reagen
New Member

Hi I have a question on what is the data type to use in MySql for LatLong

I am currently build an app with map feature that use lat long, but the problem when the data tried to sync to the database it returned error.

I use mysql not google sheet

I tried to use DECIMALS on the db setup but it returned error:
"Value โ€˜-6.188766, 106.758861โ€™ in field โ€˜lat_longโ€™ cannot be converted to type โ€˜Decimalโ€™."

I also tried GEOMETRY and it also returned an error:
The insert/update operation attempted to write an invalid geometry value to a Geometry column.

Original error message from the database: Cannot get geometry object from data you send to the GEOMETRY field

Any feedback would appreciated.

Thanks

Solved Solved
0 3 584
1 ACCEPTED SOLUTION

Did you try a text type field - varchar in MySQL.

When in doubt always try a text field. Almost anything (not everything) can be converted to and from text.

View solution in original post

3 REPLIES 3

Did you try a text type field - varchar in MySQL.

When in doubt always try a text field. Almost anything (not everything) can be converted to and from text.

Thanks alot it works!

You are welcome!!

Top Labels in this Space