csss-beedza/Source/setup-gis.nls

46 lines
1.3 KiB
Text
Raw Normal View History

2013-07-17 12:19:42 +02:00
;;
;; GIS maps (shp files) are taken from:
;; - http://download.geofabrik.de/europe/romania.html
;; - http://www.gadm.org/download
2013-07-17 16:10:47 +02:00
;; and then filtered to only keep relevant information (using qgis / arcgis)
2013-07-17 12:19:42 +02:00
2013-07-17 11:33:47 +02:00
to setup-gis
resize-world 0 250 0 125
set-patch-size 4
; initialize patch name
ask patches [ set county-name "No name" ]
; initialize county-names to an empty list
set county-names []
; import counties borders from a shp file
set romanian-county-borders-dataset gis:load-dataset "../Data/RoumADMIN.shp"
gis:set-world-envelope (gis:envelope-union-of
(gis:envelope-of romanian-county-borders-dataset))
foreach gis:feature-list-of romanian-county-borders-dataset
[ let cn gis:property-value ? "NAME_1"
set county-names fput cn county-names
2013-07-17 12:14:32 +02:00
gis:set-drawing-color grey - 3
gis:fill ? 1
gis:set-drawing-color black
2013-07-17 11:33:47 +02:00
gis:draw ? 1
;let county-color item random 14 base-colors
ask patches gis:intersecting ?
[ set county-name cn
;set pcolor county-color
]
; set centroids
create-centroids 1
[ let xy gis:location-of gis:centroid-of ?
setxy (item 0 xy) (item 1 xy)
set shape "house"
set size 2 ] ]
end