Timeline for Test whether coordinate reference system has units of meters
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 10, 2020 at 1:38 | comment | added | Robert Hijmans |
I have implemented this in terra 0.9-15 as area(x, correct=TRUE, sum=FALSE)
|
|
Dec 9, 2020 at 18:39 | comment | added | Robert Hijmans | @bugmenot123 distortion in, for example, the Mercator projection you mention is a different issue (that the linear units vary across a map). It is interesting though. For vector data one can simply project to lon/lat for area and distance computations (given competent software). But for raster data that is not as straightforward, and I will implement a method in terra that can compute the true area for rectangular grid cells; by accounting for distortion. | |
Dec 9, 2020 at 16:31 | comment | added | Josh O'Brien |
@bugmenot123 Both Robert's linearUnits() and my is_proj_in_meters() functions will return that EPSG:3857 uses meters, since that's what the info stored in the EPSG database (see here) tells you the projection uses.
|
|
Dec 9, 2020 at 8:28 | comment | added | bugmenot123 | Just to make sure, this correctly handles proper meters at high latitudes in e. g. EPSG:3857 instead of the "fake" meters the projection uses? | |
Dec 9, 2020 at 7:28 | history | edited | Robert Hijmans | CC BY-SA 4.0 |
deleted 94 characters in body
|
Dec 8, 2020 at 23:28 | history | edited | Robert Hijmans | CC BY-SA 4.0 |
deleted 4 characters in body
|
Dec 8, 2020 at 17:05 | vote | accept | Josh O'Brien | ||
Dec 8, 2020 at 17:00 | comment | added | Josh O'Brien |
For the record, sf apparently does not directly use that GDAL method. Instead, sf:::`$.crs`() calls sf:::crs_parameters() , which calls the Rcpp function CPL_crs_parameters() . sf:::`$.crs`() then extracts a to_meter element, if present, from the proj4string returned by the CPL_crs_parameters() ' invocation of the exportToProj4 GDAL method.
|
|
Dec 8, 2020 at 17:00 | comment | added | Josh O'Brien |
Thanks! Great to know about terra::linearUnits() and to have that as a direct interface to GDAL's GetLinearUnits .
|
|
Dec 8, 2020 at 7:58 | history | edited | Robert Hijmans | CC BY-SA 4.0 |
added 2 characters in body
|
Dec 8, 2020 at 7:51 | history | answered | Robert Hijmans | CC BY-SA 4.0 |