[gdal-dev] nodata in .bil format

Even Rouault even.rouault at mines-paris.org
Thu Mar 7 00:04:29 PST 2013


Selon Joaquim Luis <jluis at ualg.pt>:

> Hi,
>
> While playing a bit with Lastools I came across this behavior. I create
> outputs in both .bil and .asc ESRI formats
> The weird thing is that beeing the .hdr header file common (I mean
> exactly equal) to both outputs

I don't understand this. The .hdr file is only created/recognized for EHdr
datasets. AAIGrid datasets have both their header and samples in the .asc file
and the .hdr file isn't used in that case.


 the  .bil format does not recognize the
> nodata value.
> Is this a knwon issue?    (GDAL trunk on Windows)

No, I just managed to do :

gdal_translate byte.tif byte.bil -of ehdr -a_nodata 1

I then deleted the byte.bil.aux.xml file just to be sure it doesn't interfere

and then :

C:\gdal_trunk\gdal>gdalinfo byte.bil
Driver: EHdr/ESRI .hdr Labelled
Files: byte.bil
       byte.hdr
       byte.prj
Size is 20, 20
Coordinate System is:
PROJCS["NAD_1927_UTM_Zone_11N",
    GEOGCS["GCS_North_American_1927",
        DATUM["North_American_Datum_1927",
            SPHEROID["Clarke_1866",6378206.4,294.9786982]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
Origin = (440720.000000000000000,3751320.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Corner Coordinates:
Upper Left  (  440720.000, 3751320.000) (117d38'28.21"W, 33d54' 8.47"N)
Lower Left  (  440720.000, 3750120.000) (117d38'27.92"W, 33d53'29.51"N)
Upper Right (  441920.000, 3751320.000) (117d37'41.48"W, 33d54' 8.71"N)
Lower Right (  441920.000, 3750120.000) (117d37'41.20"W, 33d53'29.75"N)
Center      (  441320.000, 3750720.000) (117d38' 4.70"W, 33d53'49.11"N)
Band 1 Block=20x1 Type=Byte, ColorInterp=Undefined
  NoData Value=1

>
> gdalinfo lixo.bil
> ERROR 6: lixo.bil, band 1: SetNoDataValue() not supported for this dataset.

This message is displayed if GDALRasterBand::SetNoDataValue() is called. But in
normal situations, it should not, unless PAM is disabled. Are you disabling PAM
by chance ?


More information about the gdal-dev mailing list