[GRASS-user] r.in.xyz: Could open text file ~ 2.5GB

Hamish hamish_nospam at yahoo.com
Fri Oct 20 19:49:38 EDT 2006

> Eric wrote:
> > I'm trying to open a text file to scan for extents:
> > 
> > r.in.xyz -s input=2006MB_GarryTrough_1N.txt
> > output=2006MB_GarryTrough_1N method=mean type=FCELL fs=space  x=1
> > y=2 z=3 percent=100

Glynn wrote:
>      fseek(in_fd, 0L, SEEK_END);
>      filesize = ftell(in_fd);
> +    if (filesize < 0)
> +	filesize = 0x7FFFFFFF;
>      rewind(in_fd);


sorry I am busy with other commitments and don't have time to get into
the discussion more ...

just a thought though, we really don't need to store the actual
filesize, we could just as well store filesize/10 or filesize/1024 and
then adjust the other calculations for that. We just need the ratio for
G_percent(), not the exact numbers.

then for the 2gb<filesize<4gb case, maybe something like

    if (ftell(in_fd) < 0)
	filesize_div10 = -1 * (0x7FFFFFFF - ftell(in_fd))/10;

? (not sure which direction the negative result from ftell() goes)

or store it as a double... ?


More information about the grass-user mailing list