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

Hi,

i need to import a ESRI ARC/INFO BIL file into GRASS.
I think that this should be possible with r.in.bin, but I have some
questions:
I have a hdr file (header data), a blw file (world file), a clr file
(color table), the bil data file and a file with the extension "stx".
What is this file for?
How can i figure out in which projection the bil file is? The world file
(*.blw/*.bilw) only has the raster resolution and the coordinates of one
edge of the raster file. The header file only contains info on the data
organization of the bil file.

I could not find any information on the web on how to interpret the
values from the stx file. The Gdal library code does not mention the stx
file too.

Any help appreciated.

Andreas

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

On Sun, Jan 21, 2001 at 05:33:58PM +0100, Andreas Lange wrote:

Hi,

i need to import a ESRI ARC/INFO BIL file into GRASS.
I think that this should be possible with r.in.bin, but I have some
questions:
I have a hdr file (header data), a blw file (world file), a clr file
(color table), the bil data file and a file with the extension "stx".
What is this file for?
How can i figure out in which projection the bil file is? The world file
(*.blw/*.bilw) only has the raster resolution and the coordinates of one
edge of the raster file. The header file only contains info on the data
organization of the bil file.

I could not find any information on the web on how to interpret the
values from the stx file. The Gdal library code does not mention the stx
file too.

Andreas,

check this page:

http://edcnts12.cr.usgs.gov/ned/appendix2.htm
Bil format documentation

stx and friends are mentioned. Perhaps r.in.bin can be extended.

Hope this helps,

Markus Neteler

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?
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).

Thanks,

Andreas

Markus Neteler wrote:

Andreas,

check this page:

http://edcnts12.cr.usgs.gov/ned/appendix2.htm
Bil format documentation

stx and friends are mentioned. Perhaps r.in.bin can be extended.

Hope this helps,

Markus Neteler

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

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.

Just a hint,

Markus

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@jps.net>