Warnings when cropping SpatRaster or read/write NetCDF files using terra package

41 Views Asked by At

I am receiving two warning messages when using terra R packages on HPC. The same code works without warnings using Windows PC.

  1. Cropping a SpatRaster object
require(dplyr)
require(terra)

# The projection of both extent and SpatRaster objects is `EPSG:4326`
CropExtent <- terra::ext(-26, 37.5, 34, 72)
Rstr <- terra::rast("PATH_To_MAP", raw = TRUE) %>%
    terra::crop(CropExtent) %>%

# Warning message:
# In x@cpp$crop(y@cpp, snap[1], extend[1], opt) :
#  GDAL Message 6: driver GTiff does not support open option so
  1. Writing/reading a SpatRaster object (projected; EPSG:3035) into/from a NetCDF file.
# Saving NetCDF file
Map = terra::writeCDF(Rstr, filename = OutFileNC, overwrite = TRUE)
# loading NetCDF file
terra::rast("File.nc")
# Aslo when plotting the map
plot(Map)
# Warning messages:
# 1: In new_CppObject_xp(fields$.module, fields$.pointer, ...) :
# GDAL Message 1: dimension #1 (easting) is not a Longitude/X dimension. 
# 2: In new_CppObject_xp(fields$.module, fields$.pointer, ...) :
# GDAL Message 1: dimension #0 (northing) is not a Latitude/Y dimension.

Should I care about these warnings? any explanation for them?

The installed versions on the HPC are: gdal: 3.5.3 R: 4.3.2 terra: 1.7.71

0

There are 0 best solutions below