首页 文章

Netlogo:Shapefile与Raster

提问于
浏览
1

我目前正在使用NetLogo中的模型来模拟某些农场的土地利用变化 . 为此,我需要在NetLogo中使用GIS扩展 . 我远没有运行模型,但我想知道我的模型最好的方法是:

(1)使用具有农场边界的shapefile并将其与其他栅格 Map (例如距离市场的欧几里德距离)重叠

要么

(2)使用具有表示场的单元ID的栅格 . 这样,我可以在属性和其他栅格 Map 之间实现完美重叠 .

先感谢您!

2 回答

  • 0

    我怀疑答案取决于您打算如何使用GIS文件中包含的信息 . 我真正建议的是,你收集人们集成GIS的几种方式,看看看起来最相似的东西 . 这是你的第一个例子 .

    我最近有一个模型,它具有很强的空间成分,可以传播流行病 . 流行感染力受人口的强烈影响 . 我在分区域一级获得了模型中所有国家(选择国家的下拉框)作为光栅文件的人口密度 . 将其作为补丁信息导入NetLogo可有效调整栅格大小 . 然后,我将NetLogo补丁转换为实际平方公里(对于每个国家/地区),以便为每个NetLogo补丁创建填充 .

  • 2

    到这一天结束时,这是解决问题的最佳方法:

    extensions [gis] 
    globals 
    [ 
      land-use-map 
      lotid-patch-map 
      def-risk-map 
      market-dist-map 
    ] 
    
    patches-own
    [ 
      land-use 
      lotid-patch 
      def-risk 
      market-dist
    ]
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; load the maps   ;;
    ;;;;;;;;;;;;;;;;;;;;; 
    
    to load-gis
    
      clear-all
    
      set land-use-map gis:load-dataset "area2_lu_black.asc"     ;loads the land use map
      set lotid-patch-map gis:load-dataset "area2_lot.asc"       ;loads the lots map 
      set def-risk-map gis:load-dataset "area2_risk.asc"         ;loads the deforestation risk map 
      set market-dist-map gis:load-dataset "area2_mkt.asc"       ;loads the distance from markets map 
    
      gis:set-world-envelope-ds gis:envelope-of land-use-map     ;sets the envelope of the world to match that of the GIS dataset
    
      gis:apply-raster land-use-map land-use                     ;patches in the land-use-map have a specific land-use now
      gis:apply-raster lotid-patch-map lotid-patch               ;patches in the lot-id-map have a specific lot-id now
      gis:apply-raster def-risk-map def-risk                     ;patches in the def-risk-map have a specific def-risk now   
      gis:apply-raster market-dist-map market-dist               ;patches in the market-dist-map have a specific market-dist now 
    
      ask patches [
    
        if land-use = 1 [ set pcolor 64 ] ; Green = Forest
        if land-use = 2 [ set pcolor 14 ] ; Dark red = Agriculture
        if land-use = 3 [ set pcolor 45 ] ; Yellow = Reforestation 
    
      ]
    
      let view gis:load-dataset "area2.shp"                      ;load a shapefile of the properties
      gis:set-world-envelope-ds gis:envelope-of view
      foreach gis:feature-list-of view
      [
        gis:set-drawing-color white                              ;draws the line of the shapefile
        gis:draw ? 1
      ] 
    
    end
    

相关问题