Re: [R] Error opening SHP file (maptools)

From: Paul Hiemstra <p.hiemstra_at_geo.uu.nl>
Date: Tue, 11 Mar 2008 23:09:21 +0100

gerickes_at_earthlink.net schreef:
> I am having difficulty loading a points shapefile (1600 records) I generated from ArcGIS as a PointsSpatialDataFrame using the maptools readShapePoints function.
>
> library(maptools)
> surveypts <- readShapePoints(system.file("C:/temp/survey.shp", package="maptools")[1]
> Error in getinfo.shape(filen) : Error opening SHP file
>
> I've tried numerous re-exports and renames of the dataset, to no avail. I've also tried placing the shapefile in the library's shapefile folder, with the example dataset (see example below).
>
> x <- readShapePoints(system.file("shapes/survey.shp", package="maptools")[1]
>
> No luck there either. I'm quite new to R, but I can follow a manual and google well enough. However, I haven't seen anything to help me. The example point datasets load fine. I figure that I'm missing on some familiarity with R and that I don't know the tricks yet. Any help?
>
> Thanks in advance.
>
> Gericke Cook
> USDA-APHIS-PPQ
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
Hi Gericke,

Why do you use system.file? Probably it will look for survey.shp in the maptools package. Try instead:

surveypts <- readShapePoints("C:/temp/survey.shp")

For these kind of geographic questions, the r-sig-geo mailing list is maybe a better way to get good answers.

cheers and hth,
Paul

-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:     +31302535773
Fax:    +31302531145
http://intamap.geo.uu.nl/~paul

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 11 Mar 2008 - 22:13:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 11 Mar 2008 - 23:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive