Writting a BIL in ASCII format

Trimble, Beheen btrimble at SFWMD.GOV
Thu Oct 12 17:17:00 EDT 2006


Thanks Kristine. I got it. The problem was an extra file with the same
name + a '1' in front! I delete the file and it worked.

Have a wonderful day

Beheen

-----Original Message-----
From: Travis Kirstine [mailto:tkirstine at jdbarnes.com] 
Sent: Thursday, October 12, 2006 4:45 PM
To: Mapserver_user_list; Trimble, Beheen
Subject: RE: [UMN_MAPSERVER-USERS] Writting a BIL in ASCII format

Just try:
gdal_translate -of AAIGrid dq0512ne.bil test.asc


-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
Behalf Of Trimble, Beheen
Sent: Thursday, October 12, 2006 4:27 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] Writting a BIL in ASCII format


Frank,

I get this error:

C:\beheen\landuse>gdal_translate -of AAIGrid -b 3 -projwin 510724.036
106267.487 531636.641 83405.401 dq0512ne.bil test.asc
Too many command options.

Beheen



-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Thursday, October 12, 2006 3:53 PM
To: Trimble, Beheen
Cc: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: Writting a BIL in ASCII format

Trimble, Beheen wrote:
> Frank,
> 
> I can see you are all over the net helping and answering people's 
> questions. I really thank you for what you are doing. I wish I could
be 
> you! Right now I am doing my master and working full time and don't
have 
> much time to devote. I promise after I graduate (next april) I will
help 
> you guys.

Beheen,

Whew, doing a masters and holding down a full time job.  I couldn't
hack that!  I look forward to your graduating and having a bit of
breathing room to relax, and even help out some.

> This is my problem/question:
> 
>  
> 
> I was surfing the web to use gdal libs to read an ESRI BIL file and 
> write it out in ascii format. I think the gdal_translate will do but I

> am not sure which option is which! Below is the header info. If you 
> please fill the blank for me, if that is the way!
> 
>  
> 
> 1) I am using header information to translate to ascii grid, is this 
> gives me an ascii file?

If you translate to AAIGRID format, you will get an ascii raster file.

> 2) Not sure what to put in place of '?' below
> 
>  
> 
> gdal_translate -ot Byte -of AAIGrid -b 3 -outsize ? ? -srcwin ? ? ? ? 
> -projwin 510724.036 106267.487 531636.641 83405.401 -a_srs ? -a_ullr 
> 510724.036 106267.487 531636.641 83405.401 -a_nodata -9999 -mo ? -co ?

>  dq0512ne.bil dq0512ne.asc

If you want the data at full resolution for the -projwin area, then
just omit -srcwin and -outsize and you will get the data at full
resolution.
Likewise you shouldn't need -a_ullr, -mo or -co.  If you use:

gdal_translate -of AAIGrid -b 3 \
   -projwin 510724.036 106267.487 531636.641 83405.401 \
   dq0512ne.bil dq0512ne.asc

you will get an ascii grid file cut from the indicated region of the
source file, only taking band 3 but otherwise with the original values,
data type, and resolution.

> 3) Give me a hint on how to associate a color file with the resulting 
> ascii file.

What application do you want the color table to work with?  Generally
speaking the GDAL commandline utilities do not allow adding a color
table
to a raster file.

Best regards,
-- 
---------------------------------------+--------------------------------
------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo,
http://osgeo.org



More information about the mapserver-users mailing list