Preferred order of writing latitude & longitude tuples in GIS services

EPSG:4326 specifically states that the coordinate order should be latitude, longitude. Many software packages still use longitude, latitude ordering. This situation has wreaked unimaginable havoc on project deadlines and programmer sanity. The best guidance one can offer is to be fully aware of the expected axis order of each component in your software stack. PostGIS … Read more

Calculate the center point of multiple latitude/longitude coordinate pairs

Thanks! Here is a C# version of OP’s solutions using degrees. It utilises the System.Device.Location.GeoCoordinate class public static GeoCoordinate GetCentralGeoCoordinate( IList<GeoCoordinate> geoCoordinates) { if (geoCoordinates.Count == 1) { return geoCoordinates.Single(); } double x = 0; double y = 0; double z = 0; foreach (var geoCoordinate in geoCoordinates) { var latitude = geoCoordinate.Latitude * Math.PI … Read more

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

If the latitude coordinate is reported as -6.3572375290155 or -63.572375290155 in decimal degrees then you could round-off and store up to 6 decimal places for 10 cm (or 0.1 meters) precision. If the coordinate reference system (CRS) is not EPSG:4326 (e.g., EPSG:3857) then the x and y values measure a distance in meters from the … Read more

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

Time Zone Location Web Services Google Maps Time Zone API Bing Maps Time Zone API Azure Maps Time Zone API GeoNames Time Zone API TimeZoneDB API AskGeo – commercial (but arguably more accurate than GeoNames) GeoGarage Time Zone API – commercial, focusing on Nautical time zones. Raw Time Zone Boundary Data Timezone Boundary Builder – … Read more

Calculate distance between 2 GPS coordinates

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 to radians. Many languages have this function. Or its a simple calculation: radians = degrees * … Read more

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

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 interesting table has a more complete list: http://mysql.rjweb.org/doc.php/latlng : Datatype Bytes Resolution Deg*100 (SMALLINT) 4 1570 m 1.0 mi Cities DECIMAL(4,2)/(5,2) 5 1570 m 1.0 mi Cities … Read more

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

Here’s what I do: First of all I check what providers are enabled. Some may be disabled on the device, some may be disabled in application manifest. If any provider is available I start location listeners and timeout timer. It’s 20 seconds in my example, may not be enough for GPS so you can enlarge … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)