adkane
adkane

Reputation: 1441

How can I get agents to interact with the attributes of a shapefile in NetLogo

In my NetLogo model I've loaded in a shape file

set map gis:load-dataset "land_use.shp"
  gis:set-world-envelope gis:envelope-of map

and I can colour the attributes of this shape file according to whether they're on water or on land as follows:

foreach gis:feature-list-of map
[if gis:property-value ? "CODE_12" = "523" [ gis:set-drawing-color blue gis:fill ? 2.0]
if gis:property-value ? "CODE_12" = "522" [ gis:set-drawing-color green  gis:fill ? 2.0]
if gis:property-value ? "CODE_12" = "521" [ gis:set-drawing-color green  gis:fill ? 2.0] ]

With that done, how can I have my agents interact with the patches based on their colour?

For instance, in a standard model without GIS data I could have something like:

if [pcolor] of patch-here = blue [set size 2] 

Thanks

Upvotes: 3

Views: 337

Answers (1)

adkane
adkane

Reputation: 1441

I found a solution to my question:

to check
let estuaries gis:find-features map "CODE_12" "522"
if gis:intersects? estuaries self [
set color red
]
end

Upvotes: 2

Related Questions