float and double datatype is good to store latitude and longitude?
google-maps, google-maps-api-3, java, precision, type-conversion
Solution
It's not a matter of safety, its just a matter of precision. I wouldn't consider floats, but doubles are what i think are ideal here. You just need to see what's the most precision you can get out of a double and see if it fits a regular longitude/latitude value. I think it's more then enough.
Else BigDecimal is just a simple backdoor to your problem, use it if you want more precision
Problem
I am storing latitude and longitude at the server side (JAVA Platform). To store those values, I am using float and double datatype at the server side. I came to know that float and double are not a recommended primitive datatypes (which is not recommended to use currencies in professional way), because float and double having rounding precision problem. In my case, I am just comparing the stored coordinates (latitude and longitude) at the server side. Question 1: Comparing the coordinates with the datatypes (float or double) will make any problem in future? Question 2: Using big decimal is good? or Going with float or double is safer?