[gdal-dev] unwanted transparency of black color produced by gdalwarp

N D getgoing555 at gmail.com
Mon May 28 05:12:24 PDT 2012


Hello,

I am trying to crop and warp th**e enroute chart tif from FAA's
http://aeronav.faa.gov/Enroute/04-05-2012/ENR_H01.zip package with the
following commands:

1. gdal_translate -of vrt -srcwin  2203 204 21692 7591 ENR_H01.tif
ENR_H01.vrt

2. gdalwarp -wm 1000 -t_srs EPSG:3395 -srcnodata 0 -dstalpha -r bilinear
ENR_H01.vrt   ENR_H01_tmp.tif

and when I place the input tif ENR_H01.tif and output tif ENR_H01_tmp.tif
into ArcGIS Explorer to compare, I see that black lines on the original map
have become transparent on the final map: I can see basemap through them.
Also some of the black marks on the map have become dark-blue. So it looks
to me that black color is gone or has become transparent and I am not sure
how to deal with it since I am new to all of this.

Please advise! Thanks in advance for any tips/hints/directions on how to
fix it.

I tried to run command #1 with -expand rgb but I get the following error
message: "Error: band 1 has no color table"

Here's gdalinfo for ENR_H01.tif:

Driver: GTiff/GeoTIFF
Files: ../ENR_H01/ENR_H01.tif
Size is 24000, 7998
Coordinate System is:
PROJCS["US_IFR",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",45],
    PARAMETER["standard_parallel_2",33],
    PARAMETER["latitude_of_origin",39],
    PARAMETER["central_meridian",-95],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["meters",1]]
GeoTransform =
  -2843013.39, 91.6788695, -13.0175628
  1594997.51, -13.0227943, -91.6740178
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_DATETIME=2012:03:15 10:46:33
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_SOFTWARE=GPL Ghostscript 8.71
  TIFFTAG_XRESOLUTION=400
  TIFFTAG_YRESOLUTION=400
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-2843013.390, 1594997.510) (133d52'54.95"W, 47d48'36.59"N)
Lower Left  (-2947127.857,  861788.716) (131d21'53.95"W, 41d23'27.77"N)
Upper Right ( -642720.522, 1282450.447) (103d53'35.10"W, 50d14'42.26"N)
Lower Right ( -746834.989,  549241.652) (104d17'24.63"W, 43d37'18.75"N)
Center      (-1794924.190, 1072119.581) (118d35'41.32"W, 46d33'40.12"N)
Band 1 Block=400x400 Type=Byte, ColorInterp=Red
Band 2 Block=400x400 Type=Byte, ColorInterp=Green
Band 3 Block=400x400 Type=Byte, ColorInterp=Blue



 and  gdalinfo for ENR_H01_tmp.tif


Driver: GTiff/GeoTIFF
Files: ENR_H01_tmp.tif
Size is 22689, 9778
Coordinate System is:
PROJCS["WGS 84 / World Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","3395"]]
Origin = (-14605257.985280666500330,6436384.405730826780200)
Pixel Size = (133.273420682087647,-133.273420682087647)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-14605257.985, 6436384.406) (131d12' 4.55"W, 50d 7'55.86"N)
Lower Left  (-14605257.985, 5133236.898) (131d12' 4.55"W, 42d 0'20.66"N)
Upper Right (-11581417.343, 6436384.406) (104d 2'15.51"W, 50d 7'55.86"N)
Lower Right (-11581417.343, 5133236.898) (104d 2'15.51"W, 42d 0'20.66"N)
Center      (-13093337.664, 5784810.652) (117d37'10.03"W, 46d13'11.99"N)
Band 1 Block=22689x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=22689x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=22689x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=22689x1 Type=Byte, ColorInterp=Alpha


Thank you!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120528/173c9821/attachment-0001.html>


More information about the gdal-dev mailing list