You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue mapping stars objects under tmap v4:
Error in UseMethod("st_as_sf") :
no applicable method for 'st_as_sf' applied to an object of class "dimensions"
In addition: Warning messages:
1: In st_coordinates.stars(x, add_max = add_max, center = center, ...) :
center values are given for spatial coordinates
2: Unable to warp stars. Stars will be transformed now (which will take some time).
see reproducible example that fails with raster.warp set with both TRUE and FALSE:
This issue is partly solved (took me a looong time) f0a9205
Now looking at the geotransformation:
library(stars)
#> Loading required package: abind#> Loading required package: sf#> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
library(mapview)
m=matrix(1:20, 4)
s0= st_as_stars(m)
s=s0
st_crs(s) <-4326
st_crs(s0) <-4326
st_geotransform(s0) <- c(5, 1.5, 0.2, 0, 0.2, 1.5)
s0_4326= st_transform(s0, crs=4326)
stars:::is_curvilinear(s0)
#> [1] FALSEstars:::is_curvilinear(s0_4326)
#> [1] TRUEs0#> stars object with 2 dimensions and 1 attribute#> attribute(s):#> Min. 1st Qu. Median Mean 3rd Qu. Max.#> A1 1 5.75 10.5 10.5 15.25 20#> dimension(s):#> from to offset delta refsys point x/y#> X1 1 4 5 1.5 WGS 84 FALSE [x]#> X2 1 5 0 1.5 WGS 84 FALSE [y]#> sheared raster with parameters: 0.2 0.2s0_4326#> stars object with 2 dimensions and 1 attribute#> attribute(s):#> Min. 1st Qu. Median Mean 3rd Qu. Max.#> A1 1 5.75 10.5 10.5 15.25 20#> dimension(s):#> from to refsys point values x/y#> X1 1 4 WGS 84 FALSE [4x5] 5.85,...,11.15 [x]#> X2 1 5 WGS 84 FALSE [4x5] 0.85,...,7.45 [y]#> curvilinear grid
Currently, the curvilinear gridded stars work well in tmap, but the sheared gridded stars not (yet). So as workaround I might do a st_transformation to obtain a curvilinear grid.
@edzer do you have any tips how to deal with this efficiently?
I'm having an issue mapping
stars
objects undertmap
v4:see reproducible example that fails with
raster.warp
set with bothTRUE
andFALSE
:Previously this worked with
tmap
v3 whentmap_mode("view")
:but not with
tmap_mode("plot")
:The text was updated successfully, but these errors were encountered: