[GRASSLIST:1382] Re: importing ESRI-ARC/INFO BIL into GRASS

Eric G . Miller egm2 at jps.net
Sun Jan 21 17:46:17 EST 2001


On Sun, Jan 21, 2001 at 05:43:52PM +0000, Markus Neteler wrote:
> Hi Andreas,
> 
> [bounced mail to list]
> 
> On Sun, Jan 21, 2001 at 06:01:01PM +0100, Andreas Lange wrote:
> > Hi Markus, hi others,
> > 
> > thanks a lot for the hint.
> > The information in the stx file is not needed (statistics on the BIL
> > file). 
> > But am i correct that without a "prj" file i have no chance to get the
> > projection of the BIL file?
> I guess that's impossible as the BIL is a simple format.
> 
> > It is for sure not lat/lon as i can see from the values of the
> > header/world file.
> > 
> > I'll explore if the import can be done with a script (r.in.bil). 
> Perhaps a "-t" flag should be added to r.in.bin like in r.in.tiff.
> Or you write r.in.bil using the .tfw file and r.in.bin parameters.
> To decipher you can extract the old r.in.arctiff script from beta9
> if you don't want to modify r.in.bil directly.

TFW format and what it means...

/***********************************************************
 * AFFINE_FACTORS: contains the rotation, translation and  *
 * scaling factors for performing an affine transformation *
 * on a matrix using the following equation:               *
 *                                                         *
 *        x' = Ax + By + C, y' = Dx + Ey + F               *
 * where:                                                  *
 *        A = X scale factor (ew_res in map units)         *
 *        B = Y shift factor (y shift in map units)        *
 *        C = X origin (in map units)                      *
 *        D = X shift factor (x shift in map units)        *
 *        E = Y scale factor (ns_res in map units)         *
 *        F = Y origin (in map units)                      *
 *        x = matrix x column (range [0, cols - 1])        *
 *        y = matrix y row    (range [0, rows - 1])        *
 *                                                         *
 * Typical TIFF World File is arranged:                    *
 *        A                                                *
 *        D                                                *
 *        B                                                *
 *        E                                                *
 *        C                                                *
 *        F                                                *
 *                                                         *
 * one value per line.                                     *
 **********************************************************/

If there are the "B" or "D" parameters (other than zero) than the raster
would undergo some form of rotation and skewing.  The only way to handle
such a case correctly in GRASS is to import the imagery in an xy
location, calculate 3 "real world coordinates", feed those to i.points
and then run i.rectify.  Note the origin is the *center* of the upper
left pixel.  If you use the equations, it doesn't really matter (until
you need the edge extents [+/- 0.5 * resolution -- note that is the
transformed resolution which should be square, not the resolution(s) in 
the header file]).  

-- 
Eric G. Miller <egm2 at jps.net>




More information about the grass-user mailing list