[gdal-dev] Convert TIF to BIL

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Convert TIF to BIL

Bret Johnson

I have some GeoTIFF (.TIF) files that a program I’m using won’t accept.  It will accept .BIL files and I’m using GDAL to try and do the conversion.  When I do, GDAL_TRANSLATE says it worked and it generates a few files (including a .BIL), but it doesn’t create the .BLW file where all of the “real” data should be.  Is there some special GDAL_TRANSLATE option or use or some special format GeoTIFF data needs to be in for it to work properly and generate a .BLW file?


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Even Rouault-2
Bret,

> I have some GeoTIFF (.TIF) files that a program I'm using won't accept.  It
> will accept .BIL files and I'm using GDAL to try and do the conversion.
> When I do, GDAL_TRANSLATE says it worked and it generates a few files
> (including a .BIL), but it doesn't create the .BLW file where all of the
> "real" data should be.  Is there some special GDAL_TRANSLATE option or use
> or some special format GeoTIFF data needs to be in for it to work properly
> and generate a .BLW file?

I don't know which output driver you use (EHdr, ENVI etc.), but they aren't
likely to produce a .blw worldfile as they will generate a text header file
specific to the format.

To generate a .blw file you can do:

gdal_translate your_input.tif tmp.tif -co TFW=YES

This will generate a tmp.tfw file. Just rename it to .blw and with the
basename of your BIL output file.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Bret Johnson
Even:

Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.

-----Original Message-----
From: Even Rouault <[hidden email]>
Sent: Friday, March 6, 2020 1:15 PM
To: [hidden email]
Cc: Bret Johnson <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

Bret,

> I have some GeoTIFF (.TIF) files that a program I'm using won't
> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
> When I do, GDAL_TRANSLATE says it worked and it generates a few files
> (including a .BIL), but it doesn't create the .BLW file where all of
> the "real" data should be.  Is there some special GDAL_TRANSLATE
> option or use or some special format GeoTIFF data needs to be in for
> it to work properly and generate a .BLW file?

I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.

To generate a .blw file you can do:

gdal_translate your_input.tif tmp.tif -co TFW=YES

This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.

Even

--
Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Markus Neteler
Bret,

What does gdalinfo report on the file?

Markus


Bret Johnson <[hidden email]> schrieb am Fr., 6. März 2020, 19:19:
Even:

Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.

-----Original Message-----
From: Even Rouault <[hidden email]>
Sent: Friday, March 6, 2020 1:15 PM
To: [hidden email]
Cc: Bret Johnson <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

Bret,

> I have some GeoTIFF (.TIF) files that a program I'm using won't
> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
> When I do, GDAL_TRANSLATE says it worked and it generates a few files
> (including a .BIL), but it doesn't create the .BLW file where all of
> the "real" data should be.  Is there some special GDAL_TRANSLATE
> option or use or some special format GeoTIFF data needs to be in for
> it to work properly and generate a .BLW file?

I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.

To generate a .blw file you can do:

gdal_translate your_input.tif tmp.tif -co TFW=YES

This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.

Even

--
Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Bret Johnson

GDALINFO Output:

 

*****************

 

Driver: EHdr/ESRI .hdr Labelled

Files: d:\470-600N_0900-0905W.bil

       d:\X470-600N_0900-0905W.bil.aux.xml

       d:\X470-600N_0900-0905W.hdr

       d:\X470-600N_0900-0905W.prj

Size is 2784, 89882

Origin = (-10074427.220539299771190,7863030.092672790400684)

Pixel Size = (20.000000000000000,-20.000000000000000)

Metadata:

  AREA_OR_POINT=Area

Corner Coordinates:

Upper Left  (-10074427.221, 7863030.093)

Lower Left  (-10074427.221, 6065390.093)

Upper Right (-10018747.221, 7863030.093)

Lower Right (-10018747.221, 6065390.093)

Center      (-10046587.221, 6964210.093)

Band 1 Block=2784x1 Type=Int16, ColorInterp=Undefined

  Min=0.000 Max=666.000

  Minimum=0.000, Maximum=666.000, Mean=281.661, StdDev=147.479

  NoData Value=-32767

  Metadata:

    STATISTICS_APPROXIMATE=YES

    STATISTICS_MAXIMUM=666

    STATISTICS_MEAN=281.66132304577

    STATISTICS_MINIMUM=0

    STATISTICS_STDDEV=147.47884400779

    STATISTICS_VALID_PERCENT=93.76

 

*****************

 

As far as I can tell, nothing unusual there.  BTW, I’ve tried with both EHDR and ENVI and it makes no difference.

 

From: Markus Neteler <[hidden email]>
Sent: Friday, March 6, 2020 9:42 PM
To: Bret Johnson <[hidden email]>
Cc: Even Rouault <[hidden email]>; gdal-dev <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

 

Bret,

 

What does gdalinfo report on the file?

 

Markus

 

 

Bret Johnson <[hidden email]> schrieb am Fr., 6. März 2020, 19:19:

Even:

Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.

-----Original Message-----
From: Even Rouault <[hidden email]>
Sent: Friday, March 6, 2020 1:15 PM
To: [hidden email]
Cc: Bret Johnson <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

Bret,

> I have some GeoTIFF (.TIF) files that a program I'm using won't
> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
> When I do, GDAL_TRANSLATE says it worked and it generates a few files
> (including a .BIL), but it doesn't create the .BLW file where all of
> the "real" data should be.  Is there some special GDAL_TRANSLATE
> option or use or some special format GeoTIFF data needs to be in for
> it to work properly and generate a .BLW file?

I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.

To generate a .blw file you can do:

gdal_translate your_input.tif tmp.tif -co TFW=YES

This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.

Even

--
Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

jmckenna
Administrator
In reply to this post by Bret Johnson
Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:

> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Bret Johnson
The program is made by SoftWright and is called TAP, which is used for radio propagation analysis.  The relevant parts of the error message are:

Note that 1 file(s) were found that were not indexed because of errors.  There could be errors in the data file(s), or these could be files that are NOT topo data files that the program tested to try to index and failed.

Like, I said, pretty generic and not very helpful.

-----Original Message-----
From: gdal-dev <[hidden email]> On Behalf Of Jeff McKenna
Sent: Monday, March 9, 2020 8:50 AM
To: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:

> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Norman Vine-2
In reply to this post by Even Rouault-2
This might help
https://www.softwright.com/faq/support/toposcript_bil_file_format.html

---- Original Message ----
From: "Bret Johnson" <[hidden email]>
Sent: 3/9/2020 11:08:20 AM
To: "Jeff McKenna" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

The program is made by SoftWright and is called TAP, which is used for radio propagation analysis.  The relevant parts of the error message are:

Note that 1 file(s) were found that were not indexed because of errors.  There could be errors in the data file(s), or these could be files that are NOT topo data files that the program tested to try to index and failed.

Like, I said, pretty generic and not very helpful.

-----Original Message-----
From: gdal-dev <[hidden email]> On Behalf Of Jeff McKenna
Sent: Monday, March 9, 2020 8:50 AM
To: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:

> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Bret Johnson
Based on that, it looks like my program requires coordinates in decimal degrees and my files are not in that format.  How do I force the output into the correct (decimal degrees) format?

-----Original Message-----
From: nhv <[hidden email]>
Sent: Monday, March 9, 2020 9:56 AM
To: Bret Johnson <[hidden email]>; Jeff McKenna <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

This might help
https://www.softwright.com/faq/support/toposcript_bil_file_format.html

---- Original Message ----
From: "Bret Johnson" <[hidden email]>
Sent: 3/9/2020 11:08:20 AM
To: "Jeff McKenna" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

The program is made by SoftWright and is called TAP, which is used for radio propagation analysis.  The relevant parts of the error message are:

Note that 1 file(s) were found that were not indexed because of errors.  There could be errors in the data file(s), or these could be files that are NOT topo data files that the program tested to try to index and failed.

Like, I said, pretty generic and not very helpful.

-----Original Message-----
From: gdal-dev <[hidden email]> On Behalf Of Jeff McKenna
Sent: Monday, March 9, 2020 8:50 AM
To: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:

> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com 
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Cainã K. Campos


On Tue, Mar 10, 2020 at 8:47 AM Cainã K. Campos <[hidden email]> wrote:
Bret,

looks like the .blw file is not just the .tfw file renamed, as  it should have other kind of parameters such pixel size, raster rotation. Check if your .blw matches the example in the link, if not you can easily create one with a .txt file renamed to .blw.
I believe that the .tfw should be renamed to .prj as described in doc, and check if formats match also in the .prj generated with documented

In order to reproject raster to decimal degrees you should use gdalwarp with the -t_srs flag, and choose a degree projection like EPSG:4326, you may do it before translating to .BIL , like:

gdalwarp -t_srs EPSG:4326 input.tif output.tif

Caina

On Mon, Mar 9, 2020 at 8:23 PM Bret Johnson <[hidden email]> wrote:
Based on that, it looks like my program requires coordinates in decimal degrees and my files are not in that format.  How do I force the output into the correct (decimal degrees) format?

-----Original Message-----
From: nhv <[hidden email]>
Sent: Monday, March 9, 2020 9:56 AM
To: Bret Johnson <[hidden email]>; Jeff McKenna <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

This might help
https://www.softwright.com/faq/support/toposcript_bil_file_format.html

---- Original Message ----
From: "Bret Johnson" <[hidden email]>
Sent: 3/9/2020 11:08:20 AM
To: "Jeff McKenna" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

The program is made by SoftWright and is called TAP, which is used for radio propagation analysis.  The relevant parts of the error message are:

Note that 1 file(s) were found that were not indexed because of errors.  There could be errors in the data file(s), or these could be files that are NOT topo data files that the program tested to try to index and failed.

Like, I said, pretty generic and not very helpful.

-----Original Message-----
From: gdal-dev <[hidden email]> On Behalf Of Jeff McKenna
Sent: Monday, March 9, 2020 8:50 AM
To: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:
> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Bret Johnson

Tried your recommendation of GDALWARP, and received this error message:

 

ERROR 1: Too many points (529 out of 529) failed to transform, unable to compute output bounds.

Warning 1: Unable to compute source region for output window 0,0,2784,89882, skipping.

 

From: Cainã K. Campos <[hidden email]>
Sent: Tuesday, March 10, 2020 5:48 AM
To: Bret Johnson <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

 

 

 

On Tue, Mar 10, 2020 at 8:47 AM Cainã K. Campos <[hidden email]> wrote:

Bret,

 

looks like the .blw file is not just the .tfw file renamed, as  it should have other kind of parameters such pixel size, raster rotation. Check if your .blw matches the example in the link, if not you can easily create one with a .txt file renamed to .blw.

I believe that the .tfw should be renamed to .prj as described in doc, and check if formats match also in the .prj generated with documented

 

In order to reproject raster to decimal degrees you should use gdalwarp with the -t_srs flag, and choose a degree projection like EPSG:4326, you may do it before translating to .BIL , like:

 

gdalwarp -t_srs EPSG:4326 input.tif output.tif

 

Caina

 

On Mon, Mar 9, 2020 at 8:23 PM Bret Johnson <[hidden email]> wrote:

Based on that, it looks like my program requires coordinates in decimal degrees and my files are not in that format.  How do I force the output into the correct (decimal degrees) format?

-----Original Message-----
From: nhv <[hidden email]>
Sent: Monday, March 9, 2020 9:56 AM
To: Bret Johnson <[hidden email]>; Jeff McKenna <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

This might help
https://www.softwright.com/faq/support/toposcript_bil_file_format.html

---- Original Message ----
From: "Bret Johnson" <[hidden email]>
Sent: 3/9/2020 11:08:20 AM
To: "Jeff McKenna" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

The program is made by SoftWright and is called TAP, which is used for radio propagation analysis.  The relevant parts of the error message are:

Note that 1 file(s) were found that were not indexed because of errors.  There could be errors in the data file(s), or these could be files that are NOT topo data files that the program tested to try to index and failed.

Like, I said, pretty generic and not very helpful.

-----Original Message-----
From: gdal-dev <[hidden email]> On Behalf Of Jeff McKenna
Sent: Monday, March 9, 2020 8:50 AM
To: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:
> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Cainã K. Campos
Bret,

maybe gdal did not recognize source projection, try to run again with -s_srs EPSG:XXXX, where xxxx should be
the epsg code for your projection. Like:
gdalwarp -s_srs EPSG:XXXX -t_srs EPSG:4326 input.tif output.tif


On Wed, Mar 11, 2020 at 1:39 PM Bret Johnson <[hidden email]> wrote:

Tried your recommendation of GDALWARP, and received this error message:

 

ERROR 1: Too many points (529 out of 529) failed to transform, unable to compute output bounds.

Warning 1: Unable to compute source region for output window 0,0,2784,89882, skipping.

 

From: Cainã K. Campos <[hidden email]>
Sent: Tuesday, March 10, 2020 5:48 AM
To: Bret Johnson <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

 

 

 

On Tue, Mar 10, 2020 at 8:47 AM Cainã K. Campos <[hidden email]> wrote:

Bret,

 

looks like the .blw file is not just the .tfw file renamed, as  it should have other kind of parameters such pixel size, raster rotation. Check if your .blw matches the example in the link, if not you can easily create one with a .txt file renamed to .blw.

I believe that the .tfw should be renamed to .prj as described in doc, and check if formats match also in the .prj generated with documented

 

In order to reproject raster to decimal degrees you should use gdalwarp with the -t_srs flag, and choose a degree projection like EPSG:4326, you may do it before translating to .BIL , like:

 

gdalwarp -t_srs EPSG:4326 input.tif output.tif

 

Caina

 

On Mon, Mar 9, 2020 at 8:23 PM Bret Johnson <[hidden email]> wrote:

Based on that, it looks like my program requires coordinates in decimal degrees and my files are not in that format.  How do I force the output into the correct (decimal degrees) format?

-----Original Message-----
From: nhv <[hidden email]>
Sent: Monday, March 9, 2020 9:56 AM
To: Bret Johnson <[hidden email]>; Jeff McKenna <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

This might help
https://www.softwright.com/faq/support/toposcript_bil_file_format.html

---- Original Message ----
From: "Bret Johnson" <[hidden email]>
Sent: 3/9/2020 11:08:20 AM
To: "Jeff McKenna" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

The program is made by SoftWright and is called TAP, which is used for radio propagation analysis.  The relevant parts of the error message are:

Note that 1 file(s) were found that were not indexed because of errors.  There could be errors in the data file(s), or these could be files that are NOT topo data files that the program tested to try to index and failed.

Like, I said, pretty generic and not very helpful.

-----Original Message-----
From: gdal-dev <[hidden email]> On Behalf Of Jeff McKenna
Sent: Monday, March 9, 2020 8:50 AM
To: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:
> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Convert TIF to BIL

Bret Johnson

Nope, that didn’t help.  Same error message.

 

From: Cainã K. Campos <[hidden email]>
Sent: Wednesday, March 11, 2020 10:54 AM
To: Bret Johnson <[hidden email]>
Cc: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

 

Bret,

 

maybe gdal did not recognize source projection, try to run again with -s_srs EPSG:XXXX, where xxxx should be
the epsg code for your projection. Like:

gdalwarp -s_srs EPSG:XXXX -t_srs EPSG:4326 input.tif output.tif

 

 

On Wed, Mar 11, 2020 at 1:39 PM Bret Johnson <[hidden email]> wrote:

Tried your recommendation of GDALWARP, and received this error message:

 

ERROR 1: Too many points (529 out of 529) failed to transform, unable to compute output bounds.

Warning 1: Unable to compute source region for output window 0,0,2784,89882, skipping.

 

From: Cainã K. Campos <[hidden email]>
Sent: Tuesday, March 10, 2020 5:48 AM
To: Bret Johnson <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

 

 

 

On Tue, Mar 10, 2020 at 8:47 AM Cainã K. Campos <[hidden email]> wrote:

Bret,

 

looks like the .blw file is not just the .tfw file renamed, as  it should have other kind of parameters such pixel size, raster rotation. Check if your .blw matches the example in the link, if not you can easily create one with a .txt file renamed to .blw.

I believe that the .tfw should be renamed to .prj as described in doc, and check if formats match also in the .prj generated with documented

 

In order to reproject raster to decimal degrees you should use gdalwarp with the -t_srs flag, and choose a degree projection like EPSG:4326, you may do it before translating to .BIL , like:

 

gdalwarp -t_srs EPSG:4326 input.tif output.tif

 

Caina

 

On Mon, Mar 9, 2020 at 8:23 PM Bret Johnson <[hidden email]> wrote:

Based on that, it looks like my program requires coordinates in decimal degrees and my files are not in that format.  How do I force the output into the correct (decimal degrees) format?

-----Original Message-----
From: nhv <[hidden email]>
Sent: Monday, March 9, 2020 9:56 AM
To: Bret Johnson <[hidden email]>; Jeff McKenna <[hidden email]>; [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

This might help
https://www.softwright.com/faq/support/toposcript_bil_file_format.html

---- Original Message ----
From: "Bret Johnson" <[hidden email]>
Sent: 3/9/2020 11:08:20 AM
To: "Jeff McKenna" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: Re: [gdal-dev] Convert TIF to BIL

The program is made by SoftWright and is called TAP, which is used for radio propagation analysis.  The relevant parts of the error message are:

Note that 1 file(s) were found that were not indexed because of errors.  There could be errors in the data file(s), or these could be files that are NOT topo data files that the program tested to try to index and failed.

Like, I said, pretty generic and not very helpful.

-----Original Message-----
From: gdal-dev <[hidden email]> On Behalf Of Jeff McKenna
Sent: Monday, March 9, 2020 8:50 AM
To: [hidden email]
Subject: Re: [gdal-dev] Convert TIF to BIL

Hi Bret, what is the exact error message?

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services https://gatewaygeomatics.com/




On 2020-03-06 8:19 p.m., Bret Johnson wrote:
> Even:
>
> Thanks.  That worked to create a World file, so I made it past the error message.  It's still not importing correctly and the error message is so generic that it's useless (basically just says it doesn't like the data).  I'll do some more playing.
>
> -----Original Message-----
> From: Even Rouault <[hidden email]>
> Sent: Friday, March 6, 2020 1:15 PM
> To: [hidden email]
> Cc: Bret Johnson <[hidden email]>
> Subject: Re: [gdal-dev] Convert TIF to BIL
>
> Bret,
>
>> I have some GeoTIFF (.TIF) files that a program I'm using won't
>> accept.  It will accept .BIL files and I'm using GDAL to try and do the conversion.
>> When I do, GDAL_TRANSLATE says it worked and it generates a few files
>> (including a .BIL), but it doesn't create the .BLW file where all of
>> the "real" data should be.  Is there some special GDAL_TRANSLATE
>> option or use or some special format GeoTIFF data needs to be in for
>> it to work properly and generate a .BLW file?
>
> I don't know which output driver you use (EHdr, ENVI etc.), but they aren't likely to produce a .blw worldfile as they will generate a text header file specific to the format.
>
> To generate a .blw file you can do:
>
> gdal_translate your_input.tif tmp.tif -co TFW=YES
>
> This will generate a tmp.tfw file. Just rename it to .blw and with the basename of your BIL output file.
>
> Even
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev