We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
results are terra::ext() in windows os seems incorrect.
terra::ext()
> tf <- paste(tempfile(), ".tif", sep = "") > utils::download.file("https://geohabnet.s3.us-east-2.amazonaws.com/util-rasters/map_grey_background.tif", destfile = tf, method = "auto") trying URL 'https://geohabnet.s3.us-east-2.amazonaws.com/util-rasters/map_grey_background.tif' Content type 'image/tiff' length 1091916 bytes (1.0 MB) ================================================== downloaded 1.0 MB
I am running the above code and using it's result to create raster object - > terra::ext(terra::rast(tf)) Result in macOS -
> terra::ext(terra::rast(tf))
SpatExtent : -180, 180, -60, 90 (xmin, xmax, ymin, ymax)
Result in windows -
SpatExtent : 1.2571897007951e+93, 3.54207331254988e+106, -3.98175728485226e+217, 3.87995991987763e+62 (xmin, xmax, ymin, ymax)
The bad result in windows is causing -
> terra::rast(tf) > terra::crop("some_raster", terra::ext(-115, -75, 5, 32)
[crop] extents do not overlap
MacOS -
packageVersion("terra") [1] ‘1.7.39’
Win -
> packageVersion("terra") [1] ‘1.7.39’
I am running latest version of R studio in both OS.
The text was updated successfully, but these errors were encountered:
That is a download error. On Windows you should use argument mode="wb"
mode="wb"
url <- "https://geohabnet.s3.us-east-2.amazonaws.com/util-rasters/map_grey_background.tif" tf <- file.path(tempdir(), basename(url)) utils::download.file(url, destfile = tf, mode = "wb") #trying URL 'https://geohabnet.s3.us-east-2.amazonaws.com/util-rasters/map_grey_background.tif' #Content type 'image/tiff' length 1091916 bytes (1.0 MB) #downloaded 1.0 MB rast(tf) #class : SpatRaster #dimensions : 1800, 4320, 1 (nrow, ncol, nlyr) #resolution : 0.08333333, 0.08333333 (x, y) #extent : -180, 180, -60, 90 (xmin, xmax, ymin, ymax) #coord. ref. : lon/lat WGS 84 (EPSG:4326) #source : map_grey_background.tif #name : map_grey_background #min value : 2 #max value : 2
Sorry, something went wrong.
No branches or pull requests
results are
terra::ext()
in windows os seems incorrect.I am running the above code and using it's result to create raster object -
> terra::ext(terra::rast(tf))
Result in macOS -
Result in windows -
The bad result in windows is causing -
MacOS -
Win -
I am running latest version of R studio in both OS.
The text was updated successfully, but these errors were encountered: