Skip to content
New issue

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

gdal_raster_data option to not unscale #226

Open
mdsumner opened this issue Apr 5, 2024 · 1 comment
Open

gdal_raster_data option to not unscale #226

mdsumner opened this issue Apr 5, 2024 · 1 comment

Comments

@mdsumner
Copy link
Member

mdsumner commented Apr 5, 2024

why?

dsn <- "/vsicurl/https://e84-earth-search-sentinel-data.s3.us-west-2.amazonaws.com/sentinel-2-c1-l2a/60/K/WC/2023/12/S2A_T60KWC_20231229T221935_L2A/B04.tif"
ref <- vapour::gdal_raster_data(sprintf("/vsicurl/%s", srcs$red[1]), bands = c(1, 1, 1), target_dim = c(1280, 0), 
                                target_crs = "+proj=laea +lon_0=179 +lat_0=-16.5", target_ext = c(-312000,  398000, -392000,  164000), 
                                options = c("-wo", "NUM_THREADS=ALL_CPUS", "-multi"))
str(na.omit(ref[[1]]))
 num [1:2635] 0.0283 0.0538 0.048 0.0488 0.048 ...
 - attr(*, "na.action")= 'omit' int [1:1279925] 1 2 3 4 5 6 7 8 9 10 ...

workaround with band_output_type, but this shouldn't be happening

@mdsumner
Copy link
Member Author

mdsumner commented Apr 8, 2024

it's applying the scale and offset when reading the warped dataset ...

ouch, terra is doing it too

@mdsumner mdsumner changed the title gdal_raster_data is scaling ... gdal_raster_data option to not unscale Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant