[gdal-dev] Getting black lines between doqqs

Even Rouault even.rouault at spatialys.com
Mon Mar 6 10:35:15 PST 2017


On lundi 6 mars 2017 13:20:50 CET Stephen Woodbridge wrote:
> Hi,
> 
> I have a collection of doqqs that look like the two below. I trying to
> extract a small image the crosses between the two doqqs, but I'm getting
> a black line between them. When I serve them via mapserver, I'm not
> getting this.
> 
> gdalbuildvrt -addalpha tmp-tc-13110.vrt m_4012408_sw_10_h_20160528.tif
> m_4012416_nw_10_h_20160528.tif
> 
> gdal_translate -of GTiff -outsize 1360 1360 -projwin -124.083968798
> 40.8779687978 -124.076031202 40.8700312022 -co TILED=YES -co
> COMPRESS=JPEG -co JPEG_QUALITY=90 --config GDAL_TIFF_INTERNAL_MASK YES
> tmp-tc-13110.vrt oaf2-tc.tif
> 
> I get the same result regardless of the -addalpha in the gdalbuildvrt
> command.
> 
> What am I missing?

If your tiles have colar (which I supposed since they have a mask), gdalbuildvrt  (actually the 
VRT driver) doesn't take it into account as you might expect. It doesn't blend alpha/mask, but 
takes the alpha/mask value of the last source in the VRT that intersects the window of 
interest. You might have more success with

gdalwarp in1.tif in2.tif out.tif -dstalpha -te xmin ymin xmax ymax



> 
> -Steve
> 
> $ gdalinfo m_4012408_sw_10_h_20160528.tif
> Driver: GTiff/GeoTIFF
> Files: m_4012408_sw_10_h_20160528.tif
> Size is 11140, 10847
> Coordinate System is:
> 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"]]
> Origin = (-124.127892543854088,40.939476459321497)
> Pixel Size = (0.000006127013352,-0.000006127013352)
> Metadata:
>    AREA_OR_POINT=Area
> Image Structure Metadata:
>    COMPRESSION=YCbCr JPEG
>    INTERLEAVE=PIXEL
>    SOURCE_COLOR_SPACE=YCbCr
> Corner Coordinates:
> Upper Left  (-124.1278925,  40.9394765) (124d 7'40.41"W, 40d56'22.12"N)
> Lower Left  (-124.1278925,  40.8730167) (124d 7'40.41"W, 40d52'22.86"N)
> Upper Right (-124.0596376,  40.9394765) (124d 3'34.70"W, 40d56'22.12"N)
> Lower Right (-124.0596376,  40.8730167) (124d 3'34.70"W, 40d52'22.86"N)
> Center      (-124.0937651,  40.9062466) (124d 5'37.55"W, 40d54'22.49"N)
> Band 1 Block=256x256 Type=Byte, ColorInterp=Red
>    Overviews: 5570x5424, 2785x2712, 1393x1356, 697x678, 349x339,
> 175x170, 88x85
>    Mask Flags: PER_DATASET
>    Overviews of mask band: 5570x5424, 2785x2712, 1393x1356, 697x678,
> 349x339, 175x170, 88x85
> Band 2 Block=256x256 Type=Byte, ColorInterp=Green
>    Overviews: 5570x5424, 2785x2712, 1393x1356, 697x678, 349x339,
> 175x170, 88x85
>    Mask Flags: PER_DATASET
>    Overviews of mask band: 5570x5424, 2785x2712, 1393x1356, 697x678,
> 349x339, 175x170, 88x85
> Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
>    Overviews: 5570x5424, 2785x2712, 1393x1356, 697x678, 349x339,
> 175x170, 88x85
>    Mask Flags: PER_DATASET
>    Overviews of mask band: 5570x5424, 2785x2712, 1393x1356, 697x678,
> 349x339, 175x170, 88x85
> 
> 
> $ gdalinfo m_4012416_nw_10_h_20160528.tif
> Driver: GTiff/GeoTIFF
> Files: m_4012416_nw_10_h_20160528.tif
> Size is 11145, 10851
> Coordinate System is:
> 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"]]
> Origin = (-124.127899397118711,40.876995871942221)
> Pixel Size = (0.000006124881549,-0.000006124881549)
> Metadata:
>    AREA_OR_POINT=Area
> Image Structure Metadata:
>    COMPRESSION=YCbCr JPEG
>    INTERLEAVE=PIXEL
>    SOURCE_COLOR_SPACE=YCbCr
> Corner Coordinates:
> Upper Left  (-124.1278994,  40.8769959) (124d 7'40.44"W, 40d52'37.19"N)
> Lower Left  (-124.1278994,  40.8105348) (124d 7'40.44"W, 40d48'37.93"N)
> Upper Right (-124.0596376,  40.8769959) (124d 3'34.70"W, 40d52'37.19"N)
> Lower Right (-124.0596376,  40.8105348) (124d 3'34.70"W, 40d48'37.93"N)
> Center      (-124.0937685,  40.8437653) (124d 5'37.57"W, 40d50'37.56"N)
> Band 1 Block=256x256 Type=Byte, ColorInterp=Red
>    Overviews: 5573x5426, 2787x2713, 1394x1357, 697x679, 349x340,
> 175x170, 88x85
>    Mask Flags: PER_DATASET
>    Overviews of mask band: 5573x5426, 2787x2713, 1394x1357, 697x679,
> 349x340, 175x170, 88x85
> Band 2 Block=256x256 Type=Byte, ColorInterp=Green
>    Overviews: 5573x5426, 2787x2713, 1394x1357, 697x679, 349x340,
> 175x170, 88x85
>    Mask Flags: PER_DATASET
>    Overviews of mask band: 5573x5426, 2787x2713, 1394x1357, 697x679,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170306/6b4dce3e/attachment-0001.html>


More information about the gdal-dev mailing list