[gdal-dev] Looking to understand /vsicurl usage...

Even Rouault even.rouault at spatialys.com
Sun Jun 18 02:09:49 PDT 2017


On samedi 17 juin 2017 18:34:37 CEST Carl Godkin wrote:
> Hi,
> 
> The OpenTopography site provides a web service to download its SRTM data.
> See
> 
> http://www.opentopography.org/developers#SRTM
> 
> where there is an example URL for a query (that works).
> 
> What I don't understand is that
> 
> gdalinfo "/vsicurl/<example URL>"
> 
> fails with "ERROR 4: `/vsicurl/
> http://opentopo.sdsc.edu/otr/getdem?demtype=SRTMGL3&west=-120.168457&south=3
> 6.738884&east=-118.465576&north=38.091337&outputFormat=GTiff' not recognized
> as a supported file format."
> 
> but
> 
> gdalinfo "<example URL>"
> 
> works just fine.  While it's wonderful that it works, I'm looking to do
> something like this from a C++ program so I would like to understand why
> /vsicurl is not used in this situation.
> 

/vsicurl/ requires the server to accept random reading with Range HTTP headers. This is 
generally the case for HTTP server that serve static files. But in the example you show, it 
seems the server will dynamically generate the content and in that case it doesn't seem to be 
the case. It responds with chunked transfer encoding, which /vsicurl/ doesn't support.

If you just do gdalinfo http://.... , the pseudo HTTP driver will download in-memory the whole 
file with a regular non-ranged GET before passing it to other GDAL drivers.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170618/d03721b7/attachment.html>


More information about the gdal-dev mailing list