Possible Duplicate:
What is the ideal data type to use when storing latitude / longitudes in a MySQL database?
I have GPS coordinates and some service provider's converted map coordinates to save into dababase. I don't know which type of data is wise for me to save, varchar, float, double? Also easy to use.
I should be doing queries based on these data like finding locations 'greater than' or 'less than' certain distance.
"double" seemed ok. But when I looked at the value it saved in db. It looks just not nice. It added many zero to the end because I have to set a decimal and length which is just a guess based on the data I have. There is a risk that it might change. It turned out that I cannot change the decimals after there are data in it. I just scewed all the existing data if I did.
I don't know which way is efficient and right.
Does anyone have experience about this?