Using the gis extension
in NetLogo I aim to upload a large vector into NetLogo.
Between the apply-coverage
command and the following lines of codes, I picked the following because they are faster and lead to the same results (I checked using the export-world
command.
The following lines of code are inspired by this source and the book "Agent-based Modeling and GIS" by Brooks (2019).
The idea is to apply the attributes of each polygon to the centroid of each patch in order to be used.
let n 1
foreach gis:feature-list-of Parcels_2015 [
polygone ->
let center-point gis:location-of gis:centroid-of polygone
let x-coordinate item 0 center-point
let y-coordinate item 1 center-point
ask patch x-coordinate y-coordinate [
;; set an ID to the patch
set ID_temp n
set ID_Parcel gis:property-value polygone "ID_PRCL"
;; and others....
;; we set the variables of each patch
set LU gis:property-value polygone "LUCTGRY"
;; and other variable....
;;and color the map depending on the LUCTGRY
if gis:property-value polygone "LUCTGRY" = "Extensive grassland" [
set pcolor green
]
set n n + 1
]
]
I have however realized that the patches remain "square" and do not represent the "real world".
Afterward, I increased the NetLogo map so two patches would not be on the same parcels, see below :
However, in the next lines of my code (not yet written), the goal would be to work with neighboring patches. If you look at the picture, the patch identifying one parcel (in color) is the neighbor of a patch representing nothing.
So in the end, is it really possible to populate a NetLogo world with "continuous" vector GIS data ?
Yes, but no, but maybe. It depends what you actually need to do. Raster datasets in GIS are a good example of this 'problem'- they are discrete representations of real-world data, but typically broken up into cells / a grid. For example, elevation is sometimes represented in 20-30 meter cells- that doesn't mean the whole cell is the same elevation, but there are restrictions in how we can represent real world 'analog' data in a digital world. The NetLogo 'world' is similar- you can modify the resolution of your world by changing the patch sizes to best allow you to explore the question at hand. If you use a very small patch size (relative to your spatial dataset) and use something like gis:apply-coverage
, you could likely get a decent approximation of a continuous world. You could check out the Model Library example called "GIS Gradient Example" for an example of 'continuous' real-world data being represented in a grid system.
Alternatively, you may find that the gis:have-relationship? or the gis:relationship-of
functions will allow you to explore the way that your different parcels are related, and potentially process things in this way. However, it really will depend on your need / goals if either of these options would work.