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

一个人想着一个人 提交于 2019-12-11 06:20:31

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!