I am unable to load raster image into NetLogo 6.2.
Following the code:
extensions [gis]
globals [landcover1]
patches-own [habitatcover]
to setup ;; load in the GIS data
ca
set landcover1 gis:load-dataset "C:/cer_map_test.asc"
gis:set-world-envelope gis:envelope-of landcover1
gis:apply-raster landcover1 habitatcover
colormap
end
to colormap ;;color the landcover
ask patches [
if habitatcover = 1 [set pcolor orange]
if habitatcover = 2 [set pcolor lime]
if habitatcover = 3 [set pcolor brown]
if habitatcover = 4 [set pcolor green]
if habitatcover = 5 [set pcolor black]
]
end
The error message displayed:
Extension exception: error parsing number
error while observer running GIS:LOAD-DATASET
called by procedure SETUP
called by Botão 'setup'
It looks like there's an irregularity with your file that is causing the GIS extension to have trouble parsing one of the numbers.
First, try importing the raster file into ArcMap or QGIS and then re-export it as a new file. That might "just work", or it might help you identify where in the raster file the GIS extension is getting tripped up if those tools have trouble reading it too.
Failing that, you can always open up .asc files in a text editor (they are just plain-text) and manually look around and see if there's anything odd going on.
Either way, I am one of the dev's working on the GIS extension and would love to look at the file in question to see if its a bug on our end that we could fix. Perhaps you could post an issue on the GIS extension github and attach the file there.