[GRASS5] i.rectify and large files

Hamish hamish_nospam at yahoo.com
Sat Apr 8 00:24:22 EDT 2006

> > I'm having trouble with the i.rectify and my (quite large) TIFF
> > image. when I run i.rectify it stops with
> > ERROR: error while writing to temp file
> >
> > I added some debug messages and see that it fails because the temp
> > file is larger then 2 GB. I reconfigured GRASS with both
> > --enable-largefile and --enable-64bit, but no help. Looking more
> > closely at i.rectify I see that it uses open(temp_name, 0) to open
> > the temp file. Okay so the problem is probably here, on line 56 in
> > file write.c of i.rectify. I tried to add the O_LARGEFILE flag, but
> > now it doesn't get compiled as I'm not able to convince the compiler
> > that I want to have large file support for this code as well. What
> > can I do? Is there perhaps some GRASS lib function to open possibly
> > large files?
> Calmly replying to myself.
> All I had to do was add
> #define _FILE_OFFSET_BITS 64
> to the beginning of the file. Now it seems to work. This is probably
> not  the best way to do it, so if someone can tell me the correct way
> to do  this, I will fix it, and then commit changes to the CVS (time I
> contributed something back again).

Another "get the job done" approach is to use a script that adds GCPs
from the POINTS file to the TIFF via gdal_translate and then rectify
with gdalwarp.

See attached script for hints.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: i.warp61
Type: application/octet-stream
Size: 3298 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060408/751f1cd3/i.obj

More information about the grass-dev mailing list