Gis Netlogo:Shapefile与光栅
我目前正在使用NetLogo中的一个模型来模拟一些农场的土地使用变化。为此,我需要在NetLogo中使用GIS扩展。我远没有让一个模型运行,但我想知道使用我的模型的最佳方式是否是: (1) 使用带有农场边界的形状文件,并将其与其他光栅地图(如与市场的欧几里得距离)重叠 或 (2) 使用带有表示农场的单元ID的光栅。这样,我就可以在属性和其他光栅贴图之间实现完美的重叠Gis Netlogo:Shapefile与光栅,gis,netlogo,Gis,Netlogo,我目前正在使用NetLogo中的一个模型来模拟一些农场的土地使用变化。为此,我需要在NetLogo中使用GIS扩展。我远没有让一个模型运行,但我想知道使用我的模型的最佳方式是否是: (1) 使用带有农场边界的形状文件,并将其与其他光栅地图(如与市场的欧几里得距离)重叠 或 (2) 使用带有表示农场的单元ID的光栅。这样,我就可以在属性和其他光栅贴图之间实现完美的重叠 提前谢谢你 我怀疑答案取决于您打算如何使用GIS文件中包含的信息。我真正能建议的是,你收集一些人们集成GIS的方法,看看什么看起来
提前谢谢你 我怀疑答案取决于您打算如何使用GIS文件中包含的信息。我真正能建议的是,你收集一些人们集成GIS的方法,看看什么看起来最相似。这是给你的第一个例子
我最近有一个模型,它有很强的传播流行病的空间成分。传染病的传染性受人群的强烈影响。我在模型(下拉框选择国家)中获得了分区域一级的人口密度,作为光栅文件。将其作为补丁信息导入NetLogo可以有效地调整光栅的大小。然后,我将NetLogo补丁转换为现实世界的平方公里(每个国家),为每个NetLogo补丁创建人口。到今天结束时,这是解决问题的最佳方法:
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
你的尺码如何搭配?每个NetLogo单元对应的实际区域有多大?一个典型的农场有多大?谢谢JenB,到今天为止,我找到的最好方法就是在补丁中添加多个变量。所以每个像素都有一个LOT-ID,一个土地使用,一个距离标记,等等。。。我将在下面发布我的代码。正如你所看到的,我仍然在使用一个shapefile,但只是为了让NetLogo世界“更漂亮”。。。