5

I have several geoTIFFs stored on a server that I can access through http. I would like to add them as raster layers analogous to adding a local raster file through the "Add Raster Layer" button, but with an URL as source, without storing the image as a layer beforehand (in PostGIS, for example). Is that possible?

7

GDAL suppports that so it should be possible for QGIS as well. However, I could not make it work with my QGIS 2.6.0. Perhaps there is just some missing step and somebody can point what it is.

Test with GDAL and VSICURL

gdalinfo /vsicurl/http://dl.maptools.org/dl/geotiff/samples/made_up/bogota.tif
Driver: GTiff/GeoTIFF
Files: /vsicurl/http://dl.maptools.org/dl/geotiff/samples/made_up/bogota.tif
Size is 512, 512
Coordinate System is:
PROJCS["Bogota 1975 / Colombia Bogota zone",
    GEOGCS["Bogota 1975",
        DATUM["Bogota_1975",
            SPHEROID["International 1924",6378388,297.000000000005,
                AUTHORITY["EPSG","7022"]],
            AUTHORITY["EPSG","6218"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4218"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",4.599047222222222],
    PARAMETER["central_meridian",-74.08091666666667],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",1000000],
    PARAMETER["false_northing",1000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","21892"]]
Origin = (440720.000000000000000,100000.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  440720.000,  100000.000) ( 79d 6'28.18"W,  3d31'34.94"S)
Lower Left  (  440720.000,   69280.000) ( 79d 6'33.75"W,  3d48'11.17"S)
Upper Right (  471440.000,  100000.000) ( 78d49'56.53"W,  3d31'40.18"S)
Lower Right (  471440.000,   69280.000) ( 78d50' 1.80"W,  3d48'16.83"S)
Center      (  456080.000,   84640.000) ( 78d58'15.06"W,  3d39'55.82"S)
Band 1 Block=512x16 Type=Byte, ColorInterp=Gray

Good, GDAL can read the image through the URL

Create a VRT file

gdalbuildvrt remote.vrt /vsicurl/http://dl.maptools.org/dl/geotiff/samples/made_up/bogota.tif
0...10...20...30...40...50...60...70...80...90...100 - done.

Test the VRT

gdalinfo remote.vrt
Driver: VRT/Virtual Raster
Files: remote.vrt
       /vsicurl/http://dl.maptools.org/dl/geotiff/samples/made_up/bogota.tif
Size is 512, 512
...

Test with QGIS

It is possible to open the VRT with QGIS but unfortunately the image appears totally black. By playing with the Min-Max settings for the contrast stretch I could get some pixels visible but result is still bad.

enter image description here

Let's wait what better QGIS specialists will say and if this is a missing feature or a bug in QGIS. Meanwhile you can save the VRT into a physical file with gdal_translate and use that with QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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