R-ArcGIS / arcgislayers

ArcGIS Location Services
http://r.esri.com/arcgislayers/
Apache License 2.0
39 stars 9 forks source link

arc_raster() sample code error #190

Closed mmachir closed 2 months ago

mmachir commented 3 months ago

Describe the bug Running the sample code from the arc_raster() reference produces an error. Not sure if it has to do with the underlying service rather than the package, but if so, perhaps the example can be updated.

To Reproduce

library(arcgis)
#> Attaching core arcgis packages:
#> → arcgisutils v0.3.0
#> → arcgislayers v0.2.0

img_url <- "https://landsat2.arcgis.com/arcgis/rest/services/Landsat/MS/ImageServer"

landsat <- arc_open(img_url)

arc_raster(
  landsat,
  xmin = -71,
  ymin = 43,
  xmax = -67,
  ymax = 47.5,
  bbox_crs = 4326,
  width = 100,
  height = 100
)
#> Warning:
#> C:\Users\XXXXXX\AppData\Local\Temp\1\RtmpK8SNxg\file79141a585e28.tiff:
#> _TIFFVSetField:C:\Users\XXXXXX\AppData\Local\Temp\1\RtmpK8SNxg\file79141a585e28.tiff:
#> Bad value 2573 for "ExtraSamples" tag (GDAL error 1)
#> Error: [rast] cannot open this file as a SpatRaster: C:\Users\XXXXXX\AppData\Local\Temp\1\RtmpK8SNxg\file79141a585e28.tiff

Created on 2024-06-06 with reprex v2.1.0

Expected behavior Expect the code to successfully export the image as a SpatRaster or throw a meaningful error.

Additional context N/A

elipousson commented 3 months ago

I wonder if this is a passing issue with the service – I am running the development versions of everything but I was not able to reproduce the error.

JosiahParry commented 2 months ago

I think this might be an issue with conflicting GDAL installations?

mmachir commented 2 months ago

Thank you both @elipousson @JosiahParry! I do think this is almost certainly an issue with GDAL installations- I have all kinds of python envs and such on the machines that this repros on. I'll close this but if I'm able to figure out what's going on here, I'll come back and add some details in case anyone else faces a similar issue.

mmachir commented 2 months ago

Oops forgot to actually close it.