I'm building a model which demands me to load shapefiles to netlogo. I've done that and the map that appears on the view corresponds to what it is supposed to. The problem is that the shapefile is not overlapping the the patches. My shapefiles consist of x|y|attribute and I've arround 800 000 lines in the files. The ideal thing was having each line corresponding to a patch but when I execute count patches it has only 1089. And worse, each patch retrieves NaN when I ask for the attribute value. I will paste part of the code that matters to this issue:
globals [ mintempcm-dataset
maxtemphm-dataset
precipitation-dataset
meantemp-dataset
color-list
]
patches-own [
mintempcm
maxtemphm
meantemp
precipitation
]
to setup
ca
gis:load-coordinate-system (word "WGS_84_Geographic.prj")
set maxtemphm-dataset gis:load-dataset "mxtwm.shp"
gis:set-world-envelope (gis:envelope-union-of
(gis:envelope-of maxtemphm-dataset)
)
gis:apply-coverage maxtemphm-dataset "MAXTEMPHM" maxtemphm
ask patches[
set maxtemphm maxtemphm
]
gis:set-drawing-color blue
gis:draw maxtemphm-dataset 1
reset-ticks
end
Am I missing something or doing something wrong? To clarify, I need to make each coordinate of the file correspond to a patch and pass the attribute to the patch.
Thanks.
gis:apply-coverage
will not work, only polygon data will (see definition). You may wantgis:intersecting
. – Luke C