RangeShifter / RangeShiftR-package

⚠️ Archive ⚠️ of the old structure of the R package as interface to the RangeShifter simulation platform. Please use the new structure: https://github.com/RangeShifter/RangeShiftR-pkg
https://rangeshifter.github.io/RangeshiftR-tutorials/
GNU General Public License v3.0
16 stars 5 forks source link

Error reading initial distribution for landscape 0 - aborting #4

Closed robboyd closed 11 months ago

robboyd commented 1 year ago

I am trying to load species' initial distributions using .asc files with 1s and 0s. The format is identical to the habitat suitability inputs, which are read in with no problem. I get the error `At (x,y) = 1,1249 : *** Corrupted file stream in C:/Users/robboy/Documents/RangeShiftR/Inputs/init_dist_1.asc Too few entries? Unsuppoerted file encoding? (You might try to use a different one, like UTF-8.)

Error reading initial distribution for landscape 0 - aborting`

I don' think any of the suggested issues are to blame as the the initial distribution files were created in an identical manner to the habitat files, which are read in fine.

Any help would be much appreciated

scfpalmer commented 1 year ago

Hi Rob

If this is till an outstanding issue, would you please send me your habitat and initial distributions layers, and I'll take a look at them. Please mail them to me directly at s.palmer@abdn.ac.uk

Steve

robboyd commented 1 year ago

Thanks Steve. The problem was with the format of the raster files I used. The raster package spits out rasters whose xmax, ymax value has many decimal places. RangeShiftR didn't like this. Imagine others who process their rasters using the raster package might have a similar problem. Hope that helps