TransWikia.com

Read color bil file striped in QGIS, R or gdal

Geographic Information Systems Asked by Elio Diaz on November 2, 2020

I am trying to render a bil file I downloaded from this link, but in QGIS, R raster::raster() or gdal_translate it shows rotated and with stripes, as shown on the picture; I think it is a problem with the hdr file, I remember opening them in arcmap and they would show without trouble.
b

One Answer

The fix for these images was a two part solution, one for the stripes and a further one for the CRS:

First: hiding .aux file from the search path, which had redundant information to the header (.hdr), as mentioned by @Michael Stimson, this can be done by renaming the file extension or by removing the file. This fixes the stripes on the picture.

Second: QGIS doesn't recognize the .prj format that accompanies these file, which looks like this:

Projection  Universal Transverse Mercator
Datum       ITRF92
Zone        14
Units       METERS
Spheroid    GRS 80

so I copied a WKT from a shapefile .prj contents and replaced the file's, it must look like this:

PROJCS["WGS_1984_UTM_Zone_14N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-99.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

Resulting image is: enter image description here

Correct answer by Elio Diaz on November 2, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP