Abstract
QGIS is a free geoinformation system. This document collects my usage notes for QGIS focusing on usage together with MGRS (Military Grid Reference System).
Useful Plugins
- MGRS Tools 3.0.1 - Allows pointing QGIS at a specific MGRS coordinate.
EPSG Codes to Use
Description | EPSG | Recommendation |
---|---|---|
WGS84 UTM 32n | 32632 | Use this by default |
ETRS89 UTM 32n | 25832 | Possible source format; compatible for small scales |
ED50 UTM 32n | 23032 | Do not use except for legacy applications |
Gauß-Krüger Zone 2 | 31466 | Do not use except for special applications |
WGS84 world-wide | 4326 | Might sometimes make sense to use |
Google Maps | 3857 | Use as “convert from” EPSG |
Configuring an MGRS Grid
The following code can be used to create labels that indicate UTM coordinates (if one leaves out the brackets while reading) and MGRS coordinates (if one ignores the brackets while reading). This comes close to the typical notation of having the UTM parts in superscript numbers (which for sure can be configured somehow, too). Use a custom formatter expression for both axes:
case
when @grid_axis = 'x'
then
CONCAT('[', floor(@grid_number/100000), ']',
case
when (@grid_number/1000 - floor(@grid_number/100000)*100) < 10 then '0'
else ''
end,
@grid_number/1000 - floor(@grid_number/100000)*100)
when @grid_axis = 'y'
then
CONCAT('[', floor(@grid_number/100000), ']',
case
when (@grid_number/1000 - floor(@grid_number/100000)*100) < 10 then '0'
else ''
end,
@grid_number/1000 - floor(@grid_number/100000)*100)
end
Add Label Coordinates in MGRS
'32UMB' + to_string(floor(x(transform(make_point($x, $y), 'EPSG:4326', 'EPSG:25832')) - 400000)) + lpad(to_string(floor(y(transform(make_point($x, $y), 'EPSG:4326', 'EPSG:25832')) - 5600000)), 6, '0')
Tricks
Useful non-QGIS Resources
Coordinate Conversion
GeoConvert
from package geographiclib-tools
can be used to convert Google Maps LatLon to MGRS:
> echo 52.51627404556164, 13.377684321544193 | GeoConvert -m
33UUU8991619699
Also available online https://geographiclib.sourceforge.io/cgi-bin/GeoConvert or by shortlink https://is.gd/utmmgrs.
Note that Google Search results (which do not point to hostname
maps.google.com
) seem to lack the context menu for copying
the coordinate?
GeoTIFF Merging
https://gis.stackexchange.com/questions/2195
GDAL_CACHEMAX=1024 gdal_merge.py -of GTiff -co COMPRESS=LZW -co BIGTIFF=YES -o all.tiff in1.tif in2.tif ...