[R-sig-Geo] read projection file throws error

emorway emorway at usgs.gov
Fri Apr 29 05:12:11 CEST 2011


Hello,

Having searched around on some related posts I have yet to figure this one
out.  While trying to grab the spatial information of a raster I turned to
the readOGR function.  

myprj<-readOGR(dsn="c:/temp/",layer="RasterDat")

but got an error:

#Error in ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding =
input_field_name_encoding) : 
#  Cannot open file

Next, I used ArcCatalog to create an empty shapefile and imported the
spatial information from the raster to the shapefile and tried using readOGR
and readShapeSpatial on it (in case there was some issue with the raster):

myprj<-readOGR(dsn="c:/temp/",layer="dummy_ShpFile")
#Error in ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding =
input_field_name_encoding) : 
#  Cannot open file
myprj<-readShapeSpatial(system.file("c:/temp/Dummy_ShpFile.shp"))
#Error in getinfo.shape(fn) : Error opening SHP file

but I know the file is there using this command:

getinfo.shape("c:/temp/Dummy_ShpFile.shp")
#Shapefile type: PolyLine, (3), # of Shapes: 0

I have attached the 3 files associated with the raster and put the contents
of the *.prj here:

PROJCS["User_Defined_Stereographic_North_Pole",GEOGCS["GCS_User_Defined",DATUM["D_User_Defined",SPHEROID["User_Defined_Spheroid",6371200.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Stereographic_North_Pole"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-105.0],PARAMETER["Standard_Parallel_1",60.0],UNIT["Meter",1.0]]

http://r-sig-geo.2731867.n2.nabble.com/file/n6315537/RadarDat.asc
RadarDat.asc 
http://r-sig-geo.2731867.n2.nabble.com/file/n6315537/RadarDat.prj
RadarDat.prj 
http://r-sig-geo.2731867.n2.nabble.com/file/n6315537/RadarDat.asc.xml
RadarDat.asc.xml 

The post that looked most relevant appears to have had a bit of private back
and forth and so the final solution wasn't available: 
http://r.789695.n4.nabble.com/Problem-with-uploading-library-td3170455.html#a3170670
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/read-projection-file-throws-error-tp6315537p6315537.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list