In a completely different and simpler perspective:
- if you are relying on Google for showing your maps, markers, polygons, whatever, then let the calculations be done by Google!
- you save resources on your server and you simply store the latitude and longitude together as a single string (
VARCHAR
), E.g.: "-0000.0000001,-0000.000000000000001" (35 length and if a number has more than 7 decimal digits then it gets rounded);
- if Google returns more than 7 decimal digits per number, you can get that data stored in your string anyway, just in case you want to detect some flees or microbes in the future;
- you can use their distance matrix or their geometry library for calculating distances or detecting points in certain areas with calls as simple as this:
google.maps.geometry.poly.containsLocation(latLng, bermudaTrianglePolygon))
- there are plenty of "server-side" APIs you can use (in Python, Ruby on Rails, PHP, CodeIgniter, Laravel, Yii, Zend Framework, etc.) that use Google Maps API.
This way you don't need to worry about indexing numbers and all the other problems associated with data types that may screw up your coordinates.