Skip to content
Prev 13388 / 29559 Next

write/readOGR issue with date / time strings

Hi Roger,

Thanks for your patience. This one is confusing to me as I've done exactly
(well, I think exactly) the same steps in the past and it has worked fine.
 The only difference is (a) I'm using Rstudio which made me (b) update my
rgdal library version.  I've always converted date/time fields using
as.character or format().  Answers to your questions embedded below...
On 11/12/11 3:17 PM, "Roger Bivand" <Roger.Bivand at nhh.no> wrote:

            
Here's the output from loading rgdal:
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.8.0, released 2011/01/12
Path to GDAL shared files:
/Users/corriecurtice/Library/R/2.13/library/rgdal/gdal
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
Path to PROJ.4 shared files:
/Users/corriecurtice/Library/R/2.13/library/rgdal/proj
So there's a slightly newer GDAL release (1.8.1).  I'm in the process of
trying to get that installed but not having a lot of luck.  I downloaded
and installed gdal v1.8.1-1 leopard (and dependencies). I assume I need to
re-compile the rgdal package so it sees this new version but I get an
error when trying to do that:

corrie-curtices-macbook-pro:Downloads corriecurtice$ !R
R CMD INSTALL 
--configure-args='--with-gdal-config=/Library/Frameworks/GDAL.framework/Pro
grams/gdal-config 
--with-proj-include=/Library/Frameworks/PROJ.framework/Headers
--with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'
rgdal_0.7-4.tar.gz 
* installing to library ?/Users/corriecurtice/Library/R/2.13/library?
* installing *source* package ?rgdal? ...
gdal-config: /Library/Frameworks/GDAL.framework/Programs/gdal-config
checking for gcc... gcc-4.2 -arch i386 -std=gnu99
checking whether the C compiler works... no
configure: error: in
`/private/var/folders/jD/jDD8BZCHHLC-VOQmq7vTGk+++TI/-Tmp-/RtmpTlKhSZ/R.INS
TALL253fc47f/rgdal':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ?rgdal?
* removing ?/Users/corriecurtice/Library/R/2.13/library/rgdal?
* restoring previous ?/Users/corriecurtice/Library/R/2.13/library/rgdal?


I can't find the config.log file, the tmp directory referenced is empty
and it's not in my cwd.
Here's the output from the sapply:
krillGMTtime          Lat          Lon
    "factor"     "factor"     "factor"
krillGMTtime          Lat          Lon
   "integer"    "integer"    "integer"


To answer Don's question, yes I have bad LAT/LON rows when I first read
them in but they are all 999. I discard them before making my spatial
points data frame, which does in fact use those two columns for the
coordinates. I have another similar dataset where the date/time field
storage.mode is reported as "character" and not "integer", and has the
same issue.  


Thanks for the help.

Corrie