| importShapefile {PBSmapping} | R Documentation |
Imports an ESRI shapefile (.shp) into either a PolySet
or EventData.
importShapefile (fn, readDBF = TRUE, projection = 1, zone = NULL)
fn |
filename of the shapefile to import; specifying the extension is optional. |
readDBF |
Boolean value; if TRUE, it also imports the DBF
(a database containing the feature attributes) associated with the
shapefile. |
projection |
optional projection attribute to override the
default value of 1. |
zone |
optional zone attribute to override the default
value of NULL. |
This routine imports an ESRI shapefile (.shp) into either a
PolySet or EventData, depending on the type of
shapefile. It supports types 1 (Point), 3 (PolyLine), and 5 (Polygon)
and imports type 1 into EventData and types 3 and 5 into a
PolySet. In addition to the shapefile (.shp), it
requires the related index file (.shx).
If a database containing feature attributes (.dbf) exists, it
also imports this database by default. For EventData, it binds
the database's columns to the EventData object. For a
PolySet, it saves the database in a PolyData object and
attaches that object to the PolySet in an attribute named
"PolyData".
For points, EventData with columns EID, X, and
Y, possibly with other columns from the attribute database. For
polylines and polygons, a PolySet with columns PID,
SID, POS, X, and Y, possibly with an
attribute named "PolyData" that contains data from the attribute
database.