2

I'm currently using gdal version 1.11.2 (also tested this on 2.0.0) to open AWS Landsat-8 data directly from its url.

If I manually test the link in the browser, it works. If I use /vsicurl/ the returned variable is None.

from osgeo import gdal

url = 'http://landsat-pds.s3.amazonaws.com/L8/139/045/LC81390452014295LGN00/LC81390452014295LGN00_B5.TIF'

src = gdal.Open('/vsicurl/%s' %(url))

print src

How can I fix this?

1

Fixed by downgrading gdal to 1.10.1.

Would be nice to know why /vsicurl/ isnt working in more recent versions of gdal, or perhaps I'm doing something wrong.

  • There is something about AWS in GDAL 2.1 release news: "/vsicurl/: by default do not use HEAD request when detecting a AWS S3 signed URL". Perhaps you should try 2.1 and report the problem to gdal-dev mailing list if it does not work for you. – user30184 Jun 3 '16 at 13:50
1

GDAL 2.1-dev seems to make a connection:

gdalinfo http://landsat-pds.s3.amazonaws.co
m/L8/139/045/LC81390452014295LGN00/LC81390452014295LGN00_B5.TIF
Driver: GTiff/GeoTIFF
Files: none associated
Size is 7621, 7791
Coordinate System is:
PROJCS["WGS 84 / UTM zone 45N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",87],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","32645"]]
Origin = (381885.000000000000000,2512815.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Metadata:
  AREA_OR_POINT=Point
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  381885.000, 2512815.000) ( 85d50'59.56"E, 22d43' 6.56"N)
Lower Left  (  381885.000, 2279085.000) ( 85d51'59.39"E, 20d36'25.83"N)
Upper Right (  610515.000, 2512815.000) ( 88d 4'34.07"E, 22d43' 8.41"N)
Lower Right (  610515.000, 2279085.000) ( 88d 3'38.09"E, 20d36'27.50"N)
Center      (  496200.000, 2395950.000) ( 86d57'47.78"E, 21d40' 0.56"N)
Band 1 Block=512x512 Type=UInt16, ColorInterp=Gray

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.