Quantcast
Channel: Question and Answer » gdal
Viewing all articles
Browse latest Browse all 397

GDAL local files VS ftp files

$
0
0

I can successfully get raster information when the raster file is located on my local file system:

import gdal
from gdalconst import *
filename= "MOD11A1.A2012193.h11v11.005.2012196013534.hdf"
dataset = gdal.Open( filename, GA_ReadOnly )
print ( dataset.GetDriver().ShortName,dataset.GetDriver().LongName)

Output:

('HDF4', 'Hierarchical Data Format Release 4')

But, when I try this with the same raster file, which this time is located on a ftp server, I get an error:

import gdal   
from gdalconst import *
filename="ftp://ladsweb.nascom.nasa.gov/allData/5/MOD11A1/2012/193/MOD11A1.A2012193.h11v11.005.2012196013534.hdf"
dataset = gdal.Open( filename, GA_ReadOnly )
print ( dataset.GetDriver().ShortName,dataset.GetDriver().LongName)

Output with error:

ERROR 4: `/vsimem/http_1/MOD11A1.A2012193.h11v11.005.2012196013534.hdf' not recognised as a supported file format.

('HDF4', 'Hierarchical Data Format Release 4')

Why is this?


Viewing all articles
Browse latest Browse all 397

Trending Articles