如何解决Netlogo GIS扩展:栅格不会修补NetLogo世界
我正在尝试将栅格网格导入NetLogo,但是遇到很多问题。我的栅格文件只有57x41像素(我希望这里的每个像素代表一个补丁),并且世界信封是[-382875 -381135 700185 701445]。我还试图将我的栅格数据集值与.csv文件中的补丁变量fuel-code相匹配。但是,当我运行下面的代码时,我遇到了错误。我没有在netlogo中使用设定的坐标投影,因为我的原始栅格不是NetLogo可接受的投影类型(导入.asc文件时,我删除了与栅格关联的.prj文件)。下面是我的代码(包含我尝试编辑的代码的错误消息):
extensions [ csv table gis]
globals [ fuel-type-40 fuel-code setrial1]
to dictionary-file ;put in the setup procedure
ca
;load the ascii file
set setrial1 gis:load-dataset "setrial_ascii.asc"
;match dimensions of raster to the dimensions of the Netlogo world
;I've tried each of the below codes independently,not together
resize-world 0 gis:width-of setrial1 0 gis:height-of setrial1 ;ERROR: Java Heap space error
gis:set-world-envelope gis:envelope-of setrial1 ;ERROR: can't modify a patch's coordinates
;below is visuals of width and height of setrial1
print gis:height-of setrial1 ;41
print gis:width-of setrial1 ;57
print envelope-of setrial1 ;[-382875 -381135 700185 701445]
; Load the csv
set fuel-type-40 but-first csv:from-file "fuel-type-40.csv"
;print fuel-type-40
; Pull first value (Fuel-code)
set fuel-code map first fuel-type-40
;print fuel-code
ask patches [
; Randomly set patch 'land cover' for this example. change for raster
gis:apply-raster setrial1 fuel-code
]
end
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。