如何在Netlogo中应用多个光栅?

2022-09-28 19:51:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在我的模型中包括5个光栅,所有的光栅都来自同一个区域,但是当我应用超过1个光栅时,会出现以下扩展错误

Extension exception: Dimensions (width=334991 height=334992) are too large error while observer running GIS:APPLY-RASTER called by procedure DISPLAY-CLASES-IN-PATCHES called by Button 'display-clases-in-patches'

我能做什么?我认为这与

gis:set-world-envelope (gis:envelope-union-of (gis:envelope-of apt-dataset) (gis:envelope-of clases-dataset)) 

有什么不对劲吗

extensions [gis]
globals [clase-dataset 
  apt_arroz-dataset
  ]
patches-own [clase
  apt_arroz
]

设置

 clear-all
  gis:load-coordinate-system ("C:/Users/Juan Felipe/Desktop/WCS/Capas Orinoquia/ABM_gis/orq_abm.prj")
  set clase-dataset gis:load-dataset "C:/Users/Juan Felipe/Desktop/WCS/Capas Orinoquia/ABM_gis/coberturas4_abm.asc"
  set apt_arroz-dataset gis:load-dataset "C:/Users/Juan Felipe/Desktop/WCS/Capas Orinoquia/ABM_gis/apt_arroz_abm.asc"
gis:set-world-envelope (gis:envelope-union-of (gis:envelope-of apt_arroz-dataset) (gis:envelope-of clase-dataset))  

reset-ticks
end


to display-clases-in-patches
  gis:apply-raster clase-dataset clase
  let min-clase gis:minimum-of clase-dataset
  let max-clase gis:maximum-of clase-dataset
  ask patches
  [ if (clase >= 0)
    [ set pcolor scale-color black clase min-clase max-clase ] ]
end

to display-apt_arroz-in-patches
  gis:apply-raster apt_arroz-dataset apt_arroz
  let min-apt_arroz gis:minimum-of apt_arroz-dataset
  let max-apt_arroz gis:maximum-of apt_arroz-dataset
  ask patches
  [ if (apt_arroz >= 0)
    [ set pcolor scale-color black clase min-apt_arroz max-apt_arroz ] ]
end

Tags: of光栅displayaptmindatasetmaxenvelopeletsetgispatchesclaseclasesarroz