[R-sig-Geo] rgdal not correctly reading world file?

Agustin Lobo alobolistas at gmail.com
Sat Jun 20 12:39:41 CEST 2009


I see, sounds complicated. And not sure this would be of general interest.

I've been able to solve the problem
using gdaltransform through system().
Using the world files and not actually
rewriting the rotated images to disk saves
a lot of disk and time, I'm processing hundreds
of UAV images. Just adding the correct
tfw file is the best solution for an initial
positioning.

Thanks

Agus

Roger Bivand wrote:
> On Sat, 20 Jun 2009, Agustin Lobo wrote:
> 
>> Hi!
>>
>> I have a tif file along with a tifw file, the
>> last one stating a rotation. If I display the
>> tif file with a gis (i.e., qgis), the image
>> is correctly displayed with its rotation,
>> but if I use
>>> r <- raster("SDIM0413_L1.TIF")
>>> image(r)
>> or
>>> x <- GDAL.open("SDIM0413_L1.TIF")
>>> displayDataset(x, band=1)
>>
>> the image is not rotated. Does this imply
>> that rgdal is ignoring the second and third
>> entries in the world file (thus assuming 0)?
> 
> The underlying assumption is no rotation, so it is discarded. A new 
> class would be needed for holding the data, and for display the rotated 
> raster cells would have to be constructed as polygons, not the unrotated 
> rectangles expected by image() or levelplot().
> 
> Roger
> 
>>
>> (I've aslo done:
>>> r <- readGDAL("SDIM0413_L1.TIF")
>> SDIM0413_L1.TIF has GDAL driver GTiff
>> and has 1760 rows and 2640 columns
>>
>> but, as r is large, cannot use image(r) )
>>
>> Thanks
>>
>> Agus
>>
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alobolistas.vcf
Type: text/x-vcard
Size: 251 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090620/3661e3f9/attachment.vcf>


More information about the R-sig-Geo mailing list