Luke C
Luke C

Reputation: 10336

Netlogo GIS raster creation speed

I am trying to use the Netlogo GIS extension to export patch variables as raster datasets. Example code as I have been trying it (once projection and world-envelope have been set):

to store-raster

  let patches_out nobody

  ask patches [
    set patches_out gis:patch-dataset pcolor
  ]  
  gis:store-dataset patches_out "patch_out.asc"

end

This works fine for small world sizes, but the world I'm actually trying to export from is nearly 600 thousand patches; the export takes a very long while. Going the other way with (gis:apply-raster) occurs in a matter of seconds, so I can't help but think I'm missing something. Is there a faster method to extract patch variables into raster format for large world sizes? Thanks in advance.

Upvotes: 1

Views: 99

Answers (1)

Luke C
Luke C

Reputation: 10336

It turns out that just asking a single patch still exports the entire raster. Each patch was exporting the entire world. Why the gis:patch-dataset primitive isn't therefore called by the observer I don't yet understand, but at least this code solves my issue.

to store-raster-2

  let patches_out nobody

  ask one-of patches [
    set patches_out gis:patch-dataset pcolor
  ]

  gis:store-dataset patches_out "patch_out_check.asc"

end

Note: according to Robert Grider this issue is caused by a bug introduced in Netlogo 6.0; the above workaround should be fine until the issue is resolved.

Upvotes: 2

Related Questions