Quantcast
Channel: Forums - ArcGIS for Desktop - General
Viewing all articles
Browse latest Browse all 2565

for loop using GME doesn't recognize lists?

$
0
0
Has anyone successfully run a "for loop" using the Geospatial Modeling Environment (gme) where the variable is from a list of rasters?

The help file indicates that you can create a list of rasters using 'list.raster' and that the resulting variable is called rasterlist. When I try to access that list my script chokes. Unfortunately, the help pdf never gives an example of how to actually access this resulting list.For example calling rasterlist[i] in a for loop.

I've also tried creating a defined variable list like:
ids <- c(”M01.tif”,”F01.tif”,”M02.tif”);


But when I run this as part of a a loop:
for(i in 1:3){
setwd(in="V:\Project\future", out="V:\Project\birds");
isectpolyrst(in="V:\Project\my.shp",raster=ids[i], thematic=TRUE, allowpartialoverlap=TRUE);
}

I get:
"The specified raster dataset does not exist: V:\Project\future\ids[1]"

It looks like it is iterating through the numbers but is simply not recognizing the list I just created.

I've tried this about 10 different ways but simply put, GME does not seem to recognize the [i] variable in a "for loop" even though the help file seems to clearly state that this should work. Anyone out there able to figure this out?

I'm using gme v0.7.2.1
and ArcGIS v10.1

Thanks much,

DJ

Viewing all articles
Browse latest Browse all 2565

Trending Articles