Hello all,
I recently installed rgdal 0.5.24-1 (kyngchaos framework) and I am having
trouble making sense of the row, col information provided.
> a = new("GDALDataset", "dummy.tif")
> GDALinfo("dummy.tif")
rows 420
columns 660
bands 1
ll.x -55.5
ll.y -14.5
res.x 0.008333334
res.y 0.008333334
oblique.x 0
oblique.y 0
driver GTiff
projection +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
file dummy.tif> nrow(a)
[1] 420> ncol(a)
[1] 660> dummy = getRasterData(a)
> nrow(dummy)
[1] 660> ncol(dummy)
[1] 420> test = matrix(0, nrow=420, ncol=660)
> putRasterData(a,test)
Error in putRasterData(a, test) :
GDAL Error 5: Access window out of range in RasterIO(). Requested
(0,0) of size 420x660 on raster of 660x420.
Also, it appears that the lower left coordinates given by calling GDALinfo
are actually the upper left coordinates.
from command line GDAL:
sardinha$ gdalinfo dummy.tif
Driver: GTiff/GeoTIFF
Files: dummy.tif
Size is 660, 420
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.2572235630016,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-55.500000000000000,-14.500000000000000)
Pixel Size = (0.008333333767951,-0.008333333767951)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( -55.5000000, -14.5000000) ( 55d30'0.00"W,
14d30'0.00"S)
Lower Left ( -55.5000000, -18.0000002) ( 55d30'0.00"W, 18d
0'0.00"S)
Upper Right ( -49.9999997, -14.5000000) ( 50d 0'0.00"W,
14d30'0.00"S)
Lower Right ( -49.9999997, -18.0000002) ( 50d 0'0.00"W, 18d
0'0.00"S)
Center ( -52.7499999, -16.2500001) ( 52d45'0.00"W,
16d15'0.00"S)
I am not sure this is a problem, but I don't remember seeing this before.
Does anybody know if there is an older version that gives the correct
information?
Thanks,
Naiara.
[[alternative HTML version deleted]]