-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wk_crs_projjson(sf::st_crs(...)) test failure #212
Comments
I think the problem here is GDAL < 3.1.0 and crs$ProjJson = NA. We can patch this with a 1-liner, but unsure if the fix belongs here of in sf though? Line 141 in 030fcce
if (is.null(json) || is.na(json[1])) { A CRS object from the 2004 Docker environment: sf:::crs_parameters(sf::st_crs(4326))
#> $SemiMajor
#> 6378137 [m]
#>
#> $SemiMinor
#> 6356752 [m]
#>
#> $InvFlattening
#> [1] 298.2572
#>
#> $IsGeographic
#> [1] TRUE
#>
#> $units_gdal
#> [1] "degree"
#>
#> $IsVertical
#> [1] FALSE
#>
#> $WktPretty
#> [1] "GEOGCS[\"WGS 84\",\n DATUM[\"WGS_1984\",\n SPHEROID[\"WGS 84\",6378137,298.257223563]],\n PRIMEM[\"Greenwich\",0],\n UNIT[\"degree\",0.0174532925199433,\n AUTHORITY[\"EPSG\",\"9122\"]],\n AXIS[\"Latitude\",NORTH],\n AXIS[\"Longitude\",EAST],\n AUTHORITY[\"EPSG\",\"4326\"]]"
#>
#> $Wkt
#> [1] "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AXIS[\"Latitude\",NORTH],AXIS[\"Longitude\",EAST],AUTHORITY[\"EPSG\",\"4326\"]]"
#>
#> $Name
#> [1] "WGS 84"
#>
#> $proj4string
#> [1] "+proj=longlat +datum=WGS84 +no_defs"
#>
#> $epsg
#> [1] 4326
#>
#> $yx
#> [1] TRUE
#>
#> $ProjJson
#> <CHARSXP: NA>
#>
#> $WKT1_ESRI
#> [1] "GEOGCS[\"GCS_WGS_1984\",\n DATUM[\"D_WGS_1984\",\n SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],\n PRIMEM[\"Greenwich\",0.0],\n UNIT[\"Degree\",0.0174532925199433]]"
#>
#> $srid
#> [1] "EPSG:4326"
#>
#> $axes
#> name orientation
#> 1 Geodetic latitude 1
#> 2 Geodetic longitude 3
#>
#> attr(,"class")
#> [1] "crs_parameters"
attributes(sf::st_crs(4326))
#> $names
#> [1] "input" "wkt"
#>
#> $class
#> [1] "crs"
unclass(sf::st_crs(4326))
#> $input
#> [1] "EPSG:4326"
#>
#> $wkt
#> [1] "GEOGCRS[\"WGS 84\",\n DATUM[\"World Geodetic System 1984\",\n ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n CS[ellipsoidal,2],\n AXIS[\"geodetic latitude (Lat)\",north,\n ORDER[1],\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n AXIS[\"geodetic longitude (Lon)\",east,\n ORDER[2],\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n USAGE[\n SCOPE[\"unknown\"],\n AREA[\"World\"],\n BBOX[-90,-180,90,180]],\n ID[\"EPSG\",4326]]" Created on 2023-12-18 with reprex v2.0.2 |
Seems sf ensuring ProjJson has a value is intended. |
@anthonynorth Thanks for the details and for working on a fix! |
On an Ubuntu 20.04-based system, I've hit into a wk test failure:
I verified that I can trigger the same error with a Docker image based on
rstudio/r-base:4.3.1-focal
.Dockerfile
Here's what I see if I execute the R relevant code from that assertion:
System library versions:
Any idea what might be triggering the failure?
Thanks in advance
The text was updated successfully, but these errors were encountered: