I have a polygon feature data set of emergency service zones for Tucson Metropolitan Area and want to copy the polygon attributes to the patches. The code is only creating/coloring these patches.(Picture shown below).
enter image description here
I want to create a patch that covers the entire emergency service zone (second picture shown below) enter image description here
Here is my code. I tried using the vertex of the polygon and was not successful. I tried using the center of the polygon and I came out with a different output than what I want.
My code is:
to setup-gis ;; copy gis features to patches
clear-patches
show "Loading patches..."
gis:apply-coverage ESZs-dataset "STATION_NO" emergency-zone
foreach gis:feature-list-of ESZs-dataset [ feature ->
ask patches [
let centroid1 gis:location-of gis:centroid-of feature
ask patch item 0 centroid1 item 1 centroid1 [
set emergency-zone gis:property-value feature "STATION_NO"
set pcolor yellow
;show emergency-zone
]
]
]
show "Done"
end