[GRASS5] i.ortho.photo DEM reading problem
Paul Kelly
paul-grass at stjohnspoint.co.uk
Tue Nov 25 05:59:49 EST 2003
Hello Markus
On Tue, 25 Nov 2003, Markus Neteler wrote:
> We have found a problem in i.ortho.photo. Under certain
> conditions it doesn't seem to read the DEM properly.
> With a FCELL DEM, all pixels with values, we get
> in photo.rectify:
>
[...]
>
> Somehow line 91
> if ( (G_get_raster_row (elevfd, elevbuf, r2, data_type)) < 0)
> fails.
Can you not force it to always read the map as a DCELL_TYPE (especially
seeing elevbuf is a pointer to a DCELL)? From reading previous messages
on the list I think this is a good practice unless you need to preserve
integer values as it will automatically convert the values to DCELL if the
map is CELL or FCELL?.
Also further down
zz2 = (double) elevbuf[c2];
/* if target TIE point has no elevation, set to aver_z */
if (zz2 == 0) zz2 = aver_z;
z2 = zz2;
looks very suspicious and should probably be using something like
G_is_d_null_value() instead of if (zz2 == 0).
> Any ideas (maybe just from looking into the rectify.c)?
Yes that's all they are---I haven't really done any raster programming so
just provided some ideas that might help you to find something.
Paul
More information about the grass-dev
mailing list