0

I have a problem with some GeoTIFF:s that are in EPSG:3006 and I need them in EPSG:3857. The problem is that after gdalwarp, and gdalbuildvrt I get transparent stripes in the vrt map

This is one of the maps reprojected to EPSG:3857, I did not make it transparent so it will show better how the image looks.

After gdalwarp

If I now warp two maps (with transparency) into EPSG:3857 and add them to QGIS it all looks good. Command:

gdalwarp -dstalpha -dstnodata "255 255 255" -s_srs EPSG:3006 -t_srs EPSG:3857 J2aa_42_Mala_2.tif warped/J2aa_42_Mala_2_transparent.tif

Two maps side by side with transparency

But if I now create a vrt of these two maps stripes of the maps suddently disapears

Buildvrt: gdalbuildvrt test9.vrt warped/J*transparent.tif

The map after gdalbuildvrt when added to QGIS:

Transparent stripes in the map

As seen there are now transparent stripes in the vrt map

Is there anything I can do in either gdalwarp or gdalbuildvrt to prevent this from happening? Or any other way to do this so I get a vrt in EPSG:3857 with the maps?

**** SOME MORE INFORMATION****

So, I have succeded on half of the images, the ones with the white border, I just removed the -dstalpha. But half of the images is different is some way. They have a blue border around the image and these ones still give me problem

This is the gdalwarp I run:

gdalwarp -dstnodata "255 255 255" -co "COMPRESS=JPEG" -co "TILED=YES" -s_srs EPSG:3006 -t_srs EPSG:3857 infile.tif outfile.tif

And then gdalbuildvrt:

gdalbuildvrt test.vrt *.tif

If I add the GeoTiffs by them self into QGIS they look fine. But the vrt looks like below.

Blue semi transparent field

This is the information from gdalinfo on one of the images with a blue border.

    Size is 12414, 9966
Coordinate System is:
PROJCRS["SWEREF99 TM",
    BASEGEOGCRS["SWEREF99",
        DATUM["SWEREF99",
            ELLIPSOID["GRS 1980",6378137,298.257222101004,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4619]],
    CONVERSION["Transverse Mercator",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",15,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    ID["EPSG",3006]]
Data axis to CRS axis mapping: 1,2
Origin = (655527.025795543799177,7215009.693909364752471)
Pixel Size = (3.000000000000000,-3.000000000000000)
Metadata:
  AREA_OR_POINT=Area
  DataType=Generic
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  655527.026, 7215009.694) ( 18d18' 7.30"E, 65d 1'20.47"N)
Lower Left  (  655527.026, 7185111.694) ( 18d16' 9.34"E, 64d45'16.27"N)
Upper Right (  692769.026, 7215009.694) ( 19d 5'25.83"E, 65d 0'10.17"N)
Lower Right (  692769.026, 7185111.694) ( 19d 2'59.88"E, 64d44' 6.82"N)
Center      (  674148.026, 7200060.694) ( 18d40'40.79"E, 64d52'45.30"N)
Band 1 Block=128x128 Type=Byte, ColorInterp=Red
  Min=0.000 Max=254.000
  Minimum=0.000, Maximum=254.000, Mean=190.489, StdDev=67.650
  NoData Value=255
  Metadata:
    RepresentationType=ATHEMATIC
    STATISTICS_COVARIANCES=4576.531054018162,4394.433516189766,228.431113177739
    STATISTICS_MAXIMUM=254
    STATISTICS_MEAN=190.48910084315
    STATISTICS_MEDIAN=216,000000
    STATISTICS_MINIMUM=0
    STATISTICS_SKIPFACTORX=1
    STATISTICS_SKIPFACTORY=1
    STATISTICS_STDDEV=67.650063222573
Band 2 Block=128x128 Type=Byte, ColorInterp=Green
  Min=0.000 Max=254.000
  Minimum=0.000, Maximum=254.000, Mean=182.584, StdDev=65.131
  NoData Value=255
  Metadata:
    RepresentationType=ATHEMATIC
    STATISTICS_COVARIANCES=4394.433516189766,4241.999852082562,254.7048456178414
    STATISTICS_MAXIMUM=254
    STATISTICS_MEAN=182.58351941323
    STATISTICS_MEDIAN=206,000000
    STATISTICS_MINIMUM=0
    STATISTICS_SKIPFACTORX=1
    STATISTICS_SKIPFACTORY=1
    STATISTICS_STDDEV=65.130636816191
Band 3 Block=128x128 Type=Byte, ColorInterp=Blue
  Min=30.000 Max=253.000
  Minimum=30.000, Maximum=253.000, Mean=188.612, StdDev=15.632
  NoData Value=255
  Metadata:
    RepresentationType=ATHEMATIC
    STATISTICS_COVARIANCES=228.431113177739,254.7048456178414,244.3480753386218
    STATISTICS_MAXIMUM=253
    STATISTICS_MEAN=188.61166250665
    STATISTICS_MEDIAN=192,000000
    STATISTICS_MINIMUM=30
    STATISTICS_SKIPFACTORX=1
    STATISTICS_SKIPFACTORY=1
    STATISTICS_STDDEV=15.631637001243
5
  • Build the vrt and then reproject
    – Ian Turton
    Commented May 29 at 14:46
  • Reproject the vrt? Commented May 29 at 15:27
  • Do the stripes disappear if you zoom closer?
    – user30184
    Commented May 29 at 16:57
  • No, they don't disapear on zoom Commented Jun 1 at 19:09
  • Added some additional information in my question Commented Jun 1 at 19:22

1 Answer 1

0

Solved it. At least a workaround. There seemd like it was some form of problem with the images with black stripes. The no data value in these images where 256 in the original files. I ended up just opening the images in Paint.net and replaced the black border with a white one. Then I skipped the vrt and just added all the files directly to QGis, then they showed up as expected with no borders

Not the answer you're looking for? Browse other questions tagged or ask your own question.