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

emorway emorway at usgs.gov
Fri Apr 29 06:08:25 CEST 2011


Hi Michael,

Thanks for pointing out my blunders, it never pays to work late as evidenced
by such simple mistakes.  That is not to say I didn't learn anything from
your response, I certainly did.  Part of why I was trying to get at the
spatial reference information in my first post was because it doesn't appear
to get written in the code below (using the 'raster' library), which is
unfortunate because I would like to read in the resultant raster
(intermediate calcs omitted for now) to an ArcMap project?

ex1<-raster("c:/temp/RadarDat.asc")

ex1
#class       : RasterLayer 
#dimensions  : 131, 131, 17161  (nrow, ncol, ncell)
#resolution  : 4762.5, 4762.5  (x, y)
#extent      : -1704975, -1081088, -5710238, -5086350  (xmin, xmax, ymin,
ymax)
#projection  : +proj=stere +lat_0=90 +lat_ts=60 +lon_0=-105 +k=1 +x_0=0
+y_0=0 +a=6371200 +b=6371200 +units=m +no_defs 
#values      :
M:/NEXRAD_RenoRadar/2009_AsciiGridFiles/KRGX_DPA_20090605_172100_native.asc 
#min         : ? 
#max         : ? 

appears to have projection info

writeRaster(ex1,"c:/temp/whatnow",format="ascii",overwrite=TRUE,NAflag=-999)  
#class       : RasterLayer                                                     
#dimensions  : 131, 131, 17161  (nrow, ncol, ncell)                            
#resolution  : 4762.5, 4762.5  (x, y)                                          
#extent      : -1704975, -1081088, -5710238, -5086350  (xmin, xmax, ymin,
ymax)
#projection  : NA                                                              
#values      : c:/temp/whatnow.asc                                             
#min         : ?                                                               
#max         : ?                                                               

projection  : NA  ???  If I'm missing an option or specifying a certain
variable, I haven't been able to find it in the documentation.

Eric
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/read-projection-file-throws-error-tp6315537p6315605.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list