-
Notifications
You must be signed in to change notification settings - Fork 88
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
Crop (an also when crop & mask) to the output file does not change the datatype #1128
Comments
I do not see that. This is what I see:
And while the input file has a scale and offset, the output does not.
I think that first a change was made such that crop maintains the data-type, and later an additional change, to not do that when there is a scale and offset (the alternative would have been to also write the scale and offset, but I find that too much complexity to be worth it). So perhaps your version is in-between these two changes? Can you please try with the current CRAN or devel version? |
Ok, I see the problem is due to the mask (a shapefile loaded via
|
Yes, that was it. This example now also works:
|
Thank you! |
Hello,
Was there recently any change in crop to the file?
I do have an MCD12Q2 EVI2 file that when loaded using
rast()
has a scale factor applied automatically. That is fine.The problem is when I do crop to file in one line. It saves the files with the original datatype ('INT2S') and I end up with all values being 0.
When I do it in two steps: first
crop()
to variable and then the variable is saved usingwriteRaster()
then it changes the datatype according to the values and everything is ok.I am using 1.7-24 dev version on Windows.
Not long ago, everything was ok, and the output from one linear was ok!
MCD12Q2.061_EVI_Minimum_0_doy2015001_proj.zip
The text was updated successfully, but these errors were encountered: