read.shape {maptools} | R Documentation |
Read shapefile into Map object; the file should be given including its ".shp" extension, and the function will reconstruct the names of the database (dbf) file and the index (shx) file from these.
read.shape(filen, dbf.data = TRUE) getinfo.shape(filen)
filen |
name of file with *.shp extension, or *.dbf for dbf.read() |
dbf.data |
read DBF data together with shapes, default TRUE |
The function calls code from shapelib to read shapefiles, a file format used by ESRI GIS software among others
read.shape() returns either a list of shapes of class ShapeList, or if dbf.data = TRUE a Map object with:
Shapes |
a list of shapes of class ShapeList; both the individual shapes and the list have attributes |
att.data |
a data frame of data from the associated DBF file |
Nicholas J. Lewin-Koh, modified by Roger Bivand Roger.Bivand@nhh.no; shapelib by Frank Warmerdam
http://gdal.velocet.ca/projects/shapelib/
x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1]) length(x$Shapes) unlist(lapply(x$att.data, class)) str(getinfo.shape(system.file("shapes/fylk-val.shp", package="maptools")[1]))