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?
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).
- --Wolf
On Fri, 7 Apr 2006, Wolf Bergenheim wrote:
Hi all!
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?
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).
> 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.