What datatype to use when storing latitude and longitude data in SQL databases? [duplicate]

This question already has answers here: What is the ideal data type to use when storing latitude / longitude in a MySQL database? (21 answers) Closed 6 years ago. When storing latitude or longitude data in an ANSI SQL compliant database, what datatype would be most appropriate? Should float be used, or decimal, or …? … Read more

What are the lengths of Location Coordinates, latitude and longitude? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question How many digits can latitude and longitude have, before the decimal, and after the decimal? Here is an example I … Read more

How to get a time zone from a location using latitude and longitude coordinates?

Given the latitude and longitude of a location, how does one know what time zone is in effect in that location? In most cases, we are looking for an IANA/Olson time zone id, although some services may return just a UTC offset, or some other time zone identifier. Please read the timezone tag info for … Read more

Calculate distance between 2 GPS coordinates

How do I calculate distance between two GPS coordinates (using latitude and longitude)? 31 Answers 31 Calculate the distance between two coordinates by latitude and longitude, including a Javascript implementation. West and South locations are negative. Remember minutes and seconds are out of 60 so S31 30′ is -31.50 degrees. Don’t forget to convert degrees … Read more

What is the ideal data type to use when storing latitude / longitude in a MySQL database?

Bearing in mind that I’ll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database? 21 Answers 21 Basically it depends on the precision you need for your locations. Using DOUBLE you’ll have a 3.5nm precision. DECIMAL(8,6)/(9,6) goes down to 16cm. FLOAT is 1.7m… This very … Read more

What is the simplest and most robust way to get the user’s current location on Android?

The LocationManager API on Android seems like it’s a bit of a pain to use for an application that only needs an occasional and rough approximation of the user’s location. The app I’m working on isn’t really a location app per se, but it does need to get the user’s location in order to display … Read more