Skip to content

ee_imagecollection_to_local() not working #374

Open
@dominicroye

Description

@dominicroye
  • rgee version: 1.1.7
  • R version: 4.4.2
  • Operating System: Windows 11

At submit an issue, please attached the following information of your rgee session:

  • You have the Python API installed (from terminal):
earthengine -h
  • You can find the credentials file on your system:
library(rgee)
ee_path <- path.expand("~/.config/earthengine/credentials")
file.exists(ee_path)
  • You can run a simple EE command from R:

print(ee$Image('USGS/SRTMGL1_003')$getInfo())
$type
[1] "Image"

$bands
$bands[[1]]
$bands[[1]]$id
[1] "elevation"

$bands[[1]]$data_type
$bands[[1]]$data_type$type
[1] "PixelType"

$bands[[1]]$data_type$precision
[1] "int"

$bands[[1]]$data_type$min
[1] -32768

$bands[[1]]$data_type$max
[1] 32767

$bands[[1]]$dimensions
[1] 1296001 417601

$bands[[1]]$crs
[1] "EPSG:4326"

$bands[[1]]$crs_transform
$bands[[1]]$crs_transform[[1]]
[1] 0.0002777778

$bands[[1]]$crs_transform[[2]]
[1] 0

$bands[[1]]$crs_transform[[3]]
[1] -180.0001

$bands[[1]]$crs_transform[[4]]
[1] 0

$bands[[1]]$crs_transform[[5]]
[1] -0.0002777778

$bands[[1]]$crs_transform[[6]]
[1] 60.00014

Attach your Python (reticulate) configuration:

python: C:/Users/xeo19/AppData/Local/r-miniconda/python.exe
libpython: C:/Users/xeo19/AppData/Local/r-miniconda/python312.dll
pythonhome: C:/Users/xeo19/AppData/Local/r-miniconda
version: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:20:11) [MSC v.1938 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/Users/xeo19/AppData/Local/r-miniconda/Lib/site-packages/numpy
numpy_version: 2.2.1
ee: C:\Users\xeo19\AppData\Local\R-MINI~1\Lib\site-packages\ee_init_.p

NOTE: Python version was forced by use_python() function

Description

# USDA example
loc <- ee$Geometry$Point(-99.2222, 46.7816)
collection <- ee$ImageCollection('USDA/NAIP/DOQQ')$
  filterBounds(loc)$
  filterDate('2008-01-01', '2020-01-01')$
  filter(ee$Filter$listContains("system:band_names", "N"))

# From ImageCollection to local directory
ee_crs <- collection$first()$projection()$getInfo()$crs
geometry <- collection$first()$geometry(proj = ee_crs)$bounds()
tmp <- tempdir()

## Using drive
# one by once
ic_drive_files_1 <- ee_imagecollection_to_local(
  ic = collection,
  region = geometry,
  scale = 250,
  dsn = file.path(tmp, "drive_")
)

─────────────────────────────────────────────────────────────────────────────────────── Downloading ImageCollection - via drive ──Error in file(file, "rt"): Cannot open connection

What I Did

I tried to use ee_image_to_drive() which works but then ee_drive_to _local() fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions