getinfo.shape: Get shapefile header information

Description Usage Arguments Details Value Author(s) References Examples

View source: R/shapelib.R

Description

Get shapefile header information; 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.

Usage

1
2
3
getinfo.shape(filen)
## S3 method for class 'shapehead'
print(x, ...)

Arguments

filen

name of file with *.shp extension

x

a shapehead list as returned by getinfo.shape

...

other arguments passed to print

Details

The function calls code from shapelib to read shapefiles, a file format used by ESRI GIS software among others

Value

The function returns a list of class shapehead.

Author(s)

Roger Bivand Roger.Bivand@nhh.no; shapelib by Frank Warmerdam

References

http://shapelib.maptools.org/

Examples

1
2
3
res <- getinfo.shape(system.file("shapes/fylk-val.shp", package="maptools")[1])
res
str(res)

Example output

Loading required package: sp
Checking rgeos availability: FALSE
 	Note: when rgeos is not available, polygon geometry 	computations in maptools depend on gpclib,
 	which has a restricted licence. It is disabled by default;
 	to enable gpclib, type gpclibPermit()
Shapefile type: PolyLine, (3), # of Shapes: 97
List of 5
 $ fname    : chr "/usr/lib/R/site-library/maptools/shapes/fylk-val.shp"
 $ type     : int 3
 $ entities : int 97
 $ minbounds: num [1:4] -4868 6456207 0 0
 $ maxbounds: num [1:4] 1084722 7841997 0 0
 - attr(*, "class")= chr "shapehead"

maptools documentation built on Sept. 7, 2021, 5:09 p.m.