'Hide Road shapefile after create it's network in NetLogo
I would like to clear shape file in NetLogo world but i can not do this. network line (on road shape file) is created and match with road shape file. Now i should clear road shape file and keep just road network. can u help me to do this?
with respect regard
extensions [ gis ]
globals [ roads-dataset scooter-dataset ]
breed [ nodes node ]
breed [ scooters scooter ]
breed [ walkers walker ]
walkers-own [ wlocation ]
scooters-own [slocation]
to setup
; reset
clear-all
reset-ticks
; load data set
; gis:load-coordinate-system ("WGS 1984.prj")
set roads-dataset gis:load-dataset "layer/road.shp"
;set scooter-dataset gis:load-dataset "layer/lands.shp"
gis:set-world-envelope (gis:envelope-of roads-dataset)
; draw data set
gis:set-drawing-color blue
gis:draw roads-dataset 1
make-road-network
end
to make-road-network
clear-links
let first-node nobody
let previous-node nobody
foreach gis:feature-list-of roads-dataset [ ; each polyline
foreach gis:vertex-lists-of ? [ ; each polyline segment / coordinate pair
foreach ? [ ; each coordinate
let location gis:location-of ?
if not empty? location [ ; some coordinates are empty []
create-nodes 1 [
set color green
set size 1
set xcor item 0 location
set ycor item 1 location
set hidden? true
if first-node = nobody [
set first-node self
]
if previous-node != nobody [
create-link-with previous-node
]
set previous-node self
]
]
]
set previous-node nobody
]
]
; connect adjacent polylines/roads
ask nodes [ create-links-with other nodes in-radius 0.001 ]
end
Solution 1:[1]
just remove the line gis:set-drawing-color blue
Best, A
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | amik89 |