[gdal-dev] open shapefile from server
Mateusz Loskot
mateusz at loskot.net
Fri Feb 18 16:15:46 EST 2011
On 18/02/11 19:51, Even Rouault wrote:
> Le vendredi 18 février 2011 15:53:45, Mateusz Loskot a écrit :
>> On 18/02/11 14:25, Chaitanya kumar CH wrote:
>>> Rashad,
>>>
>>> Read the documentation on VSIInstallCurlFileHandler() in the cpl_vsi.h
>>> file documentation.
>>> http://www.gdal.org/cpl__vsi_8h.html
>>
>> Nice features indeedb, but it does not guarantee "without
>> downloading the whole file", does it? It depends on what part of
>> file is being read, doesn't it?
>
> With GDAL 1.8.0, you can try :
>
> poDS = OGRSFDriverRegistrar::Open("
> /vsicurl/http://mywebsite.com/shapefiles/myshape.shp", FALSE );
>
> Yes /vsicurl is no magic. If there's a VSIFReadL() call that reads the whole
> file in a single gulp, then the whole file would be downloaded of course, but
> most GDAL/OGR drivers try to only read the minimum necessary at open time. In
> the case of the shapefile driver, it will read essentially only the header of
> the .shp, .shx and .dbf files
Thanks Even for the explanation.
Nice feature indeed.
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org
More information about the gdal-dev
mailing list