问题
When importing rasters into NetLogo, there is an additional row or column of NaN cells that are added along one of the borders of the NetLogo world, which does not exist in the raster.
Is this the same issue that was raised here: https://github.com/NetLogo/GIS-Extension/issues/5 ? In my case though, they are not random cells that have a value of NaN but cells along a border.
EDIT: Here's the code I used to import the raster layer:
set rasterLayer gis:load-dataset "x.asc"
resize-world 0 gis:width-of rasterLayer 0 gis:height-of rasterLayer
gis:set-world-envelope gis:envelope-of rasterLayer
gis: apply-raster rasterLayer
回答1:
Thanks a lot Seth this comment from the thread you shared solves the mystery:
'the netlogo world starts at 0, while the gis:width-of an ascii starts at 1.'
So I think subtracting 1 while setting the width and height of the NetLogo world would help.
来源:https://stackoverflow.com/questions/49292705/importing-raster-data-into-netlogo-results-in-a-row-column-of-nan-values