Unsure about how to convert GeoTIFF files to .BIL files.

Discussion about RailWorks route design.

Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Thu Mar 17, 2022 11:15 am

I'm attempting to follow this tutorial (viewtopic.php?f=7&t=17791) in order to download some 1 arc-second data for a route I want to work on. Unfortunately, it seems that something has changed with the USGS site since the tutorial was uploaded, and the option to download the terrain data as a GridFloat is now gone, instead I can only download data as a GeoTiff. I'm struggling to figure out now how to open the GeoTiffs in MicroDEM in order to convert them to the .BIL files that the tutorial specifies. Any help would be appriciated.
*!!thnx!!*
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby BoostedFridge » Thu Mar 17, 2022 11:41 pm

Brickrail782 wrote:I'm attempting to follow this tutorial (http://railworksamerica.com/forum/viewt ... =7&t=17791) in order to download some 1 arc-second data for a route I want to work on. Unfortunately, it seems that something has changed with the USGS site since the tutorial was uploaded, and the option to download the terrain data as a GridFloat is now gone, instead I can only download data as a GeoTiff. I'm struggling to figure out now how to open the GeoTiffs in MicroDEM in order to convert them to the .BIL files that the tutorial specifies. Any help would be appriciated.
*!!thnx!!*


There are several ways to convert TIFF files to BIL format. I use a free program called QGIS, which makes the process very straightforward and easy. This same program can be used to stitch together multiple DEM files into a single file for use with ReDEM. The older 2.18 version of QGIS is actually easier to use for these purposes than the newest one. I believe both versions are still available.

You can also use a batch file to convert the formats. There is a download on the main USGS website for a variety of these, including a TIFF to BIL script. The download link is buried deep on some obscure page on the site, but you should be able to search the file name to help shortcut the process. The file is called "USGS_Raster_Conversion_Scripts"
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Fri Mar 18, 2022 6:53 am

Just installed QGIS, I'm going to have to check it out later. Thanks!
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Fri Mar 18, 2022 11:27 am

Probably a dumb question, but exactly how to I use QGIS to do the conversion, where is it explained in the documentation?
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby BoostedFridge » Sat Mar 19, 2022 8:28 pm

QGIS is an incredibly powerful program with hundreds of functions. What we are using it for is barely scratching the surface of its uses. Their documentation is very in depth, but seemingly oriented towards those with some schooling in GIS type software.

I have posted a tutorial showing the step by step process to convert (and merge if needed) .TIF files to the .BIL format here: http://www.railworksamerica.com/forum/viewtopic.php?f=7&t=23901#p270204
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Sun Mar 20, 2022 12:47 pm

Thanks for the tutorial. Unfortunately, I'm getting this error message when I'm trying to convert the .TIF file over to the .BIL format:

"Invalid Layer: GDAL provider Cannot open GDAL dataset C:/Users/kruck/Desktop/terrain data/tampa test.bil: `C:/Users/kruck/Desktop/terrain data/tampa test.bil' not recognized as a supported file format. Raster layer Provider is not valid (provider: gdal, URI: C:/Users/kruck/Desktop/terrain data/tampa test.bil"
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby BoostedFridge » Sun Mar 20, 2022 2:47 pm

Brickrail782 wrote:Thanks for the tutorial. Unfortunately, I'm getting this error message when I'm trying to convert the .TIF file over to the .BIL format:

"Invalid Layer: GDAL provider Cannot open GDAL dataset C:/Users/kruck/Desktop/terrain data/tampa test.bil: `C:/Users/kruck/Desktop/terrain data/tampa test.bil' not recognized as a supported file format. Raster layer Provider is not valid (provider: gdal, URI: C:/Users/kruck/Desktop/terrain data/tampa test.bil"


I'm going to need some more info to try to help you troubleshoot this. Please post a screenshot of the folder containing the input file. Exactly when (in relation to the numbered steps from the tutorial I posted yesterday) is this error message occuring? Also, which version of QGIS are you using?
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Sun Mar 20, 2022 4:05 pm

The error is occuring in step 12, and I am using QGIS Desktop 2.18.28.

Here's the screenshot of the input file:
You do not have the required permissions to view the files attached to this post.
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby BoostedFridge » Sun Mar 20, 2022 4:50 pm

Are you converting a single .TIF file specifically? Or the whole folder?

If you are converting a single .TIF file, try a different one than you first did.
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Sun Mar 20, 2022 8:59 pm

I'm trying to do them one by one. I'll give a different file a shot.
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Sun Mar 20, 2022 9:06 pm

Same thing. Got a .BIL and a .BIL.ERS, but still got the same error message, and BILxSRTM still can't find any BIL data.
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby BoostedFridge » Mon Mar 21, 2022 9:33 pm

Brickrail782 wrote:Same thing. Got a .BIL and a .BIL.ERS, but still got the same error message, and BILxSRTM still can't find any BIL data.


Strange. I downloaded a few of the .TIF files that I can see in your source folder to try on my end. The three I picked at random worked fine, and converted to the .bil file and associated supporting files.

I'm using QGIS version 2.18.19. I don't see anything in the changelog of the program between 2.18.19 and 2.18.28 that should cause any issue either.


Give this workflow a try:

Open QGIS

Click on the 'Layer' drop down menu
Mouse over to 'Add Layer' in that menu
Mouse over to 'Add Raster Layer' from the 'Add layer' submenu, and click on it
Navigate to the location of the .TIF file you want to convert, and select it
- A greyscale overview of the terrain in this .TIF file will load - (Florida is pretty flat, so the image may be almost entirely white except for coastlines)
Click on the 'Raster' drop down menu
Mouse over to 'Conversion' in that menu
Mouse over to 'Translate (convert format)' in that submenu and click on it
Click the 'Select' button next to 'Output file'
Type in the name that you want the .BIL files to have
Click on the drop down menu beside 'Save as Type' and scroll to 'ESRI .hdr Labelled (.bil .BIL)' and click on that
Click 'Save' at the bottom of that window
Click 'OK' at the 'Translate (Covert Format)' window

You should get a 'Processing Completed' pop up window after a second or two to indicate the conversion is complete

Let me know if that works for you.
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Tue Mar 22, 2022 9:01 am

Nope. Still no change. I think I'll try using the other version of QGIS that you're using, maybe there was some minute change between them that the dev forgot to mention that's causing this. If not, I'll have to see about re-installing GDAL, that could be where the problem really lies.
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby Brickrail782 » Tue Mar 22, 2022 11:08 am

Good news, I'm no longer getting an error with QGIS, unfortunately, BILxSRTM still doesn't seem to recognize that there's any BIL data to convert.
User avatar
Brickrail782
 
Posts: 624
Joined: Fri Jul 07, 2017 6:47 am
Location: Kansas City, KS

Re: Unsure about how to convert GeoTIFF files to .BIL files.

Unread postby BoostedFridge » Tue Mar 22, 2022 8:08 pm

Brickrail782 wrote:Good news, I'm no longer getting an error with QGIS, unfortunately, BILxSRTM still doesn't seem to recognize that there's any BIL data to convert.


That's some progress at least. So the switch to QGIS 2.18.19 was the only change you made on that part of the process?

BILxSRTM could be looking for one of the auxiliary files to the .bil file in order to identify it. Give the steps below a try.

Open QGIS
Click on the 'Raster' drop down menu
Mouse over the 'Projections' submenu
Click on 'Extract Projection' in that submenu
Click on 'Select' next to 'Input File'
Navigate to the .BIL file you are looking to convert, and either double click on it, or select it in the window and click 'Open' at the bottom of that window
Press 'OK' in the 'Extract Projection' window
This should very quickly process, and a pop up window will indicate the process is complete.
Navigate to the folder where your .BIL file is. There will now be another small (1kb) file named the same as your .BIL file, but with a '.WLD' file extension.
Click on this files name bar, or right click on it and click 'Rename'
leave the name of the file the same, but change the extension to '.BLW' instead of .wld
A window will pop up warning you that changing the extension could cause the file to be unstable etc... Click OK.

Paste a new copy of the zipped BILxSRTM program folder into this folder.
Use the 'Extract Here' function of 7zip, or whatever zip program you use to unzip files on the zipped BILxSRTM
Run BILxSRTM and navigate to the correct folder.
(I recommend creating a separate subfolder for your output location)
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Next

Return to Route Design

Who is online

Users browsing this forum: No registered users and 2 guests

cron