| Title: | What the Package Does (One Line, Title Case) |
|---|---|
| Description: | What the package does (one paragraph). |
| Authors: | Michael Sumner [aut, cre] (ORCID: <https://orcid.org/0000-0002-2471-7511>) |
| Maintainer: | Michael Sumner <[email protected]> |
| License: | `use_mit_license()`, `use_gpl3_license()` or friends to pick a license |
| Version: | 0.0.0.9000 |
| Built: | 2026-06-05 07:24:08 UTC |
| Source: | https://github.com/hypertidy/mgrsrev |
UTM CRS (EPSG code) for an MGRS zone and hemisphere
mgrs_crs(zone, northp)mgrs_crs(zone, northp)
zone |
Integer UTM zone number (1-60). |
northp |
Logical or integer; TRUE/1 = northern hemisphere. |
Character EPSG string, e.g. "EPSG:32755".
r <- mgrs_reverse("55GEP") mgrs_crs(r["zone"], r["northp"]) # [1] "EPSG:32755" # Full pattern: code -> lonlat bbox # r <- mgrs_reverse("55GEP") # reproj::reproj_extent(r[c("xmin","xmax","ymin","ymax")], # "EPSG:4326", source = mgrs_crs(r["zone"], r["northp"]))r <- mgrs_reverse("55GEP") mgrs_crs(r["zone"], r["northp"]) # [1] "EPSG:32755" # Full pattern: code -> lonlat bbox # r <- mgrs_reverse("55GEP") # reproj::reproj_extent(r[c("xmin","xmax","ymin","ymax")], # "EPSG:4326", source = mgrs_crs(r["zone"], r["northp"]))
Decode an MGRS code to a UTM bounding box
mgrs_reverse(code)mgrs_reverse(code)
code |
Character MGRS code, spaces optional, e.g. "55GEP", "31UCT037872". Must be a standard UTM-zone code (GZD starts with digits 1-60). Precision 0-5 supported (4/5-char to 14/15-char codes). |
Returns the SW-corner bbox of the MGRS square, consistent with the NGA spec (truncation, not rounding). For precision 0, the full 100 km square; for precision N the sub-cell is 1e5 / 10^N metres on each side. Polar UPS zones (A, B, Y, Z) are not handled. No validity check is performed: any syntactically parseable code is decoded. Use mgrs_crs() to obtain the corresponding EPSG code.
Named numeric vector: zone UTM zone number (1-60) northp 1 = northern hemisphere, 0 = southern xmin, xmax UTM easting of SW/NE corner (metres) ymin, ymax UTM northing of SW/NE corner (metres, false northing in S hemi)
mgrs_crs
mgrs_reverse("55GEP") mgrs_reverse("55GEP5050") # precision 2, 1 km cellmgrs_reverse("55GEP") mgrs_reverse("55GEP5050") # precision 2, 1 km cell
Vectorised wrapper around mgrs_reverse
mgrs_reverse_df(codes)mgrs_reverse_df(codes)
codes |
Character vector of MGRS codes |
data.frame with columns zone, northp, xmin, xmax, ymin, ymax