Skip to content

Reading Shapefile from 600 directories

2 messages · cheong yoon ling, Roger Bivand

#
Hi!

I am wondering how to read shapefiles from 600 respective folders at
one shot? The name of the shapefile is the same thoroughly. The name
of the 600 folders is indexed in a main autocad .dwg file.

Thanks a lot

Grace
#
On Mon, 22 Jun 2009, cheong yoon ling wrote:

            
If you can read the list of folders in appropriate software, and pass it 
into R as a character vector, yes, of course. Note that the .dwg formats 
are proprietary and cannot be read in R - can you discover the folder 
names in any other way? Are there shapefiles with the same name in other 
folders, or can you just search the file system for the target shapefile 
name? Once you have the vector of folder names, just loop over them using 
your choice of shapefile reading function and prefered object class in R 
(packages rgdal, maptools, maybe others too). Your choice will depend on 
why you want to read them in.

Roger