Define list of shapefiles in same folder (List.Vector) to use in For Loop -- Geospatial Modeling Environment -


i trying create list of shapefiles in geospatial modeling environment using list.vector. works , produces following list.

list.vector(in="d:\buffers", match="*.shp"); 

d:\buffers\objectid_1.shp, d:\buffers\objectid_10.shp, d:\buffers\objectid_100.shp,
d:\buffers\objectid_1000.shp, d:\buffers\objectid_10000.shp......

i loop through different shapefiles using isectpolypoly function. code is:

list<-list.vector(in="d:\buffers", match="*.shp");  (i in 1:length(list)) {  isectpolypoly(in=paste(i), poly="d:\polygons\agri.shp", field="p_", thematic=true, proportion=true);  }; 

i receive following error.

error: loop has not been specified correctly. length function not appear refer defined vector.

so appears if not defining "list" correctly able use in loop. cannot find clear answers on how this.

can me change code can define list of shapefiles , loop through shapefiles in list?

in case interested managed solve own problem.

i couldn't recall list, , each of shapefiles had unique number identifier, possible loop through numbers.

wd<-"d:\buffers\"; (i in 10001:10006); {  isectpolypoly(in=paste(wd,"objectid_",i,".shp"), poly="d:\polygons\agri.shp",  field=“class”,  prefix="p_",  thematic=true, proportion=true)  }; 

Comments

Popular posts from this blog

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -