[R-sig-Geo] readOGR cannot open .shp file

MacQueen, Don macqueen1 at llnl.gov
Fri Oct 3 23:22:23 CEST 2014


What does
  list.files()
show ‹ after having set the working directory, of course.

Have you successfully loaded other shape files before, or is this the
first time?

Do any of the shape file examples in ?readOGR succeed?

Is the shape file complete? That is, are the .prj, .dbf, .shx, and so on,
files there?
(I¹m not sure what the complete required list is)

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 10/3/14, 12:15 PM, "GraysonLee08" <gray.vanderlinde at gmail.com> wrote:

>I'm certain this is just user error however I can't seem to load a
>specific
>shape file into my current project. Any assistance would be greatly
>appreciated. 
>
>To start off, I'm trying to load the 2010 census tracts for the city of
>Chicago so I can show population density. I've installed and loaded the
>following packages:
>
>     ## Install packages
>     install.packages("rgdal")
>
>     ## Load packages
>     library(rgdal)
>     library(ggplot2)
>     library(rgeos)
>     library(map tools)
>     library(ggmap)
>
>
>In the loading process for rgdal I notice that the version of rgdal that
>was
>loaded is 0.9-1 and the version of GDAL is 1.9.2. Additionally, Path to
>GDAL
>shared files is
>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rgdal/gdal
>
>Loaded PROJ.4 runtime: Rel. 4.8.0
>Path to PROJ.4 shared files:
>/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rgdal/prom
>
>I've set my working directory to the location of the .shp file
>     getwd()
>     [1] "/Users/Gray/Dropbox/School/Food Desert"
>
>and use the following command to store my shape file:
>     ChicagoCensusTract2010 <- readOGR(dsn = ".", "ChicagoCensusTract")
>
>I'm receiving the following error and am not really sure what to do next.
>     Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding,
>use_iconv = use_iconv,  :
>       Cannot open file
>
>I'd really appreciate any help I can get on this.
>
>
>
>--
>View this message in context:
>http://r-sig-geo.2731867.n2.nabble.com/readOGR-cannot-open-shp-file-tp7587
>228.html
>Sent from the R-sig-geo mailing list archive at Nabble.com.
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list