Skip to main content
88 votes

Measuring accuracy of latitude and longitude

POINT #1. lets differentiate Precision from Accuracy As it is clear from the picture we can talk about Accuracy of a measurement (e.g. GPS measurement) if we already know the actual value (exact ...
Hossein Narimani Rad's user avatar
68 votes

Measuring accuracy of latitude and longitude

I think this XKCD is a perfect answer to this question :) https://xkcd.com/2170/
Yuri Astrakhan's user avatar
36 votes

Calculating latitude and longitude of points using QGIS

With QGIS 3 you can use two simple expressions doing all the reprojection in one go without having to care about settings or projections of the layer. To get decimal degrees as float values use: For x ...
MrXsquared's user avatar
  • 34.9k
25 votes
Accepted

What format is a location represented like this?

The coordinates are in MGRS (Military Grid Reference System) which is a projected coordinate system. Those coordinates give you an accuracy of 0.1 meters since there are 10 trailing digits. You can ...
PMK's user avatar
  • 1,200
24 votes
Accepted

What types of lat/long coordinates are these?

They are likely "Degrees, Decimal Minutes". Conversion to Decimal Degrees You can convert it to "Decimal Degrees" by diving the "Decimal Minutes" by 60 and adding the result to the Degrees: 21.440 /...
kttii's user avatar
  • 3,630
21 votes

Calculating correct longitude when it's over |180|?

An answer that avoids conditionals and function calls: longitude = (longitude % 360 + 540) % 360 - 180 I wrote a quick microbenchmark at https://jsperf.com/longitude-normalisation and the ...
Joe Lee-Moyet's user avatar
19 votes
Accepted

Calculating correct longitude when it's over |180|?

You need to repeatedly add (or subtract) 360 to your value until it lies in the range of -180 - 180. So usually a pair of loops like: lon = -187; while(lon < -180){ lon +=360; } while (lon > ...
Ian Turton's user avatar
  • 82.2k
19 votes
Accepted

Why does the same UTM northing give different values when converted to latitude?

This is perfectly normal behaviour in a transverse Mercator projection. The fact that a specific northing does not match a specific latitude (except for the Equator itself) can be easily visualized. ...
FSimardGIS's user avatar
  • 3,846
19 votes

What does "¢" mean in a coordinate?

Your viewer, or the website, has some problem with the fonts. Perhaps your browser does not get access to the defined fonts. Works for me, though, and this is how it should look: Coordinates are ...
user30184's user avatar
  • 67.3k
17 votes
Accepted

What kind of coordinates are 38,40.1365N, 75,4.23933W?

Mobile devices use WGS84 coordinates, and the coordinates might be displayed in different formats. One of them is DDM format. A comma for separating degree and minute, a dot for decimal. Your ...
Kadir Şahbaz's user avatar
16 votes

Calculating latitude and longitude of points using QGIS

Since QGIS 3.8 (June 2019), there is now an algorithm to add the X and Y values called "Add X/Y fields to layer". It can reproject coordinates on the fly. If you still need a Degree Minute ...
etrimaille's user avatar
  • 7,290
16 votes

Finding distance between two points with GeoSeries.distance

import geopandas as gpd from shapely.geometry import Point geom = [Point(xy) for xy in zip([117.454361,117.459880], [38.8459879,38.846255])] gdf = gpd.GeoDataFrame(geometry=geom, crs={'init':'epsg:...
CJ Xu's user avatar
  • 341
15 votes

How do I search for a coordinate in QGIS?

You can use the coordinate window in the status bar to pan the map to this location. Enter your coordinate in a lon, lat format (note that it's the reverse order of how you wrote it here), and press ...
HDunn's user avatar
  • 8,666
15 votes
Accepted

Flipping coordinates with Shapely

You can use a simple transformation function with shapely.ops' transform function. For example: def flip(x, y): """Flips the x and y coordinate values""" return y,...
inc42's user avatar
  • 830
13 votes
Accepted

What is the projection for point(x,y)?

There are plenty of ways to do this using both open source (pyproj, gdal, postgis) and commercial libraries (ArcGIS). If it's just a one time work, you could use this service from Boundless: http://...
Alex Tereshenkov's user avatar
13 votes
Accepted

Finding distance between two points with GeoSeries.distance

This is a distance in degrees, the coordinates of your data. I can get this using Pythagoras' theorem from your coordinates: >>> a = [117.454361, 38.8459879] >>> b = [117.45988, 38....
Spacedman's user avatar
  • 65.1k
12 votes

Is there a way to use a spatial query to invert X and Y coordinates in QGIS?

I propose a solution using PyQGIS: the several codes instantly work from the Python Console, but they can easily be implemented in separate scripts (see the edit at the end of the answer). Each script ...
mgri's user avatar
  • 16.3k
12 votes

How do I search for a coordinate in QGIS?

You have 2 options (well, it is QGIS, so maybe more) --> use the coordinate window in the status bar --> install the super-simple plugin "Zoom to Point"
AndreasK's user avatar
  • 1,235
11 votes

Measuring accuracy of latitude and longitude

The other excellent answers here are primarily about latitude. A degree of longitude shrinks from about 111 km at the equator to 0 at the poles, so the nominal precision of a decimal degree of ...
John's user avatar
  • 528
11 votes
Accepted

Verifying formula that will convert longitude 0-360 to -180 to 180?

Here is an example for fortran: Variables in explanation: long1 is the longitude varying from -180 to 180 or 180W-180E long3 is the longitude variable from 0 to 360 (all positive) To convert ...
kttii's user avatar
  • 3,630
11 votes

Latitude, longitude, projections, CRS

Latitude-Longitude coordinates are not projected, they live on an ellipsoid. Occasionally, you'll find lat-lon values referenced to a sphere instead. This ellipsoid is, however, defined by a ...
JGH's user avatar
  • 42.3k
11 votes
Accepted

Extracting Latitude/Longitude from polygon vertices in QGIS

Open your attribute table of the layer you want to add this information to and its field calculator. Create a new field with data type double/real and give it a length and precision of your choice. ...
MrXsquared's user avatar
  • 34.9k
11 votes
Accepted

Converting lat/lon to Postal code using Python

You can use geopy and its Nominatim geocoder. Here is an example using the DataFrame you provided: import geopy import pandas as pd def get_zipcode(df, geolocator, lat_field, lon_field): ...
Marcelo Villa's user avatar
11 votes
Accepted

Creating square polygon around center of the point using Python

Maybe you can adapt from this code which makes use of Shapely's buffer method through GeoPandas with a squared caps style: import geopandas as gpd from math import sqrt from shapely import wkt def ...
swiss_knight's user avatar
  • 10.5k
11 votes
Accepted

Converting coordinates from cartesian to geodetic in QGIS

The Show coordinates in use option is for visualization purposes. It doesn't affect the expression. You need to transform. Use this for X: x(transform($geometry, @layer_crs, 'EPSG:4326')) and for Y: ...
Kadir Şahbaz's user avatar
10 votes

leaflet map crs is 3857 but coordinates 4326

This is a feature, not a bug. Most Leaflet users are not aware that the map's display CRS is different from the map's data CRS, and that's fine; it makes life simpler for most people. If your ...
IvanSanchez's user avatar
  • 10.3k
10 votes

Is there a way to use a spatial query to invert X and Y coordinates in QGIS?

You can use the Affine Transformation plugin to do this. It's not particularly fast, so you might want to try on some fairly simple geometries to begin with. Also, it only works with editable layers, ...
Steven Kay's user avatar
  • 20.5k
10 votes

Creating polygon using coordinates

To give an example according to @geom recommendation. You must use the syntax to define polygons in WKT format, here an example in CSV: Finally use add delimited text data source: With the ...
SamTux's user avatar
  • 446
10 votes

Extracting Latitude/Longitude from polygon vertices in QGIS

If you need latitude and longitude as csv you may simply right click your vertices layer and choose Export > Save Features as...: Then in the dialogue chose Comma Separated Value [CSV] in the combo ...
Jochen Schwarze's user avatar
10 votes

How to get lat and lon from a GeoPandas geodataframe polygon

Your data is in a projected coordinated system, and your coordinates are perfectly normal not "odd" at all. Just reproject your geodataframe to a geographic CRS, e.g EPSG:4326 nc_counties = ...
user2856's user avatar
  • 67.2k

Only top scored, non community-wiki answers of a minimum length are eligible