1

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 
  • Sorry about that, this is the code I use 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 patchVariableA` – Anisha Jayadevan Mar 20 '18 at 06:39
  • perhaps related: https://stackoverflow.com/questions/33437711/extension-exception-1944553-while-applying-raster-netlogo-gis – Seth Tisue Mar 21 '18 at 00:29
  • I think https://github.com/NetLogo/GIS-Extension/issues/5 is not relevant here. – Seth Tisue Mar 21 '18 at 00:30

1 Answers1

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.