VectorFeature in a shapefile for a road network

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VectorFeature in a shapefile for a road network

Sara Vicario
Hello, 

I am using this code to create my roadnetwork in Netlogo from a shapefile. However, I got an error in foreach gis:vertex-lists-of ? because ? is not recognised as VectorFeature in my VectorDataSet roads.

How can I solve this issue?
to make-road-network
  clear-links
  let first-node nobody
  let previous-node nobody
  foreach gis:feature-list-of roads [ ; 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
    ]
  ]


endThank you,
Sara