87
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 ...
63
votes
Measuring accuracy of latitude and longitude
I think this XKCD is a perfect answer to this question :)
https://xkcd.com/2170/
30
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 ...
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 ...
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 /...
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 ...
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 > ...
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.
...
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 ...
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 ...
16
votes
Accepted
Convert Lon Lat to XY in Openlayers 3
When you transform you always transform pair of points:
ol.proj.transform([23.4, 42.5], 'EPSG:4326','EPSG:3857');
(this transforms from EPSG 4326 to EPSG 3857; the coordinates are [lon, lat])
15
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 ...
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 ...
15
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:...
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,...
14
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....
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://...
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 ...
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"
11
votes
Detecting and fixing outliers in a GPS trajectory
Algorithm I use.
Calculate Euclidean minimum spanning tree of points:
Find 2 points most far apart from each other on this network
Find shortest route between them:
As one can see it might cut ...
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 ...
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. ...
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):
...
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:
...
10
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 ...
10
votes
Using Python to field calculate Lat/Long with decimal degrees rather than meters
As stated in the tool documentation for Calculate Field:
Python expressions can use the geometry area and length properties with an areal or linear unit to convert the value to a different unit of ...
10
votes
Accepted
Getting all vertex lat, long coordinates every 1 meter between two known points using PHP?
This is quick and dirty. Most of this was adapted from the following website:
http://www.movable-type.co.uk/scripts/latlong.html
I haven't tested this too much but it seemed to work after initial ...
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 ...
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, ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
latitude-longitude × 938coordinate-system × 243
qgis × 150
coordinates × 123
python × 91
convert × 63
distance × 62
gps × 48
arcgis-desktop × 46
r × 45
shapefile × 44
utm × 44
xy × 38
postgis × 36
polygon × 28
wgs84 × 27
spherical-geometry × 26
google-maps × 23
csv × 23
raster × 22
point × 21
geometry × 21
geocoding × 18
gdal × 17
arcmap × 16