Anisha Jayadevan
Anisha Jayadevan

Reputation: 185

Importing raster data into NetLogo results in a row/column of NaN values

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 

Upvotes: 1

Views: 220

Answers (1)

Anisha Jayadevan
Anisha Jayadevan

Reputation: 185

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.

Upvotes: 1

Related Questions