Re: Anyone has already forgotten the /vsicurl/ prefix?
Daniel Evans via gdal-dev <[email protected]>
| Newsgroups | gmane.comp.gis.gdal.devel |
|---|---|
| Message-ID | <CANnaQaaMe=NaZT5H_SB8Tt78_5jWBd+UhvPbdo-LBzxONn1kbA@mail.gmail.com> |
Hi Even, Taking the example for my own typical use case, S3, it'd be great if GDAL understood the standard s3:// prefix, rather than having to add "is this URL going to GDAL? If so convert it into the special GDAL form" lines throughout my codebase. I therefore fully support the idea of doing it for any widely used protocols. Kudos to rasterio for usually doing that effort for me, but I recently did have to drop down to GDAL and got tripped up again. Cheers, Daniel On Fri, 27 Mar 2026, 17:08 Even Rouault via gdal-dev, < [email protected]> wrote: > Hi, > > I suspect that almost every GDAL user, even the most experienced, has > made the mistake of typing "gdalinfo https://example.com/my.tif" instead > of "gdalinfo /vsicurl/https://example.com/my.tif". Both commands work, > but the first one triggers the HTTP pseudo-driver which downloads the > entire file into memory before passing it to the GeoTIFF driver, while > the second reads it in chunks. > > I would be inclined to modify the GDALOpen() logic with the following > tweak: if the passed filename starts with "http://" or "https://", > automatically prepend "/vsicurl/", unless the string has query > parameters. That restriction about not having query parameters is > because in most of the cases this is for dynamically generated resources > that don't support range requests. > > For users really wanting to go through the HTTP pseudo-driver, we'd > modify it to accept a "HTTP:" prefix before the URL or it would trigger > if using the "-if HTTP" argument of command line utilities (or > allowed_drivers = ["HTTP"] in the API) > > So this change wouldn't be fully backwards compatible, but I feel it > would still make more people happy than unhappy. > > Thoughts? > > Even > > -- > http://www.spatialys.com > My software is free, but my time generally not. > > _______________________________________________ > gdal-dev mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/gdal-dev > _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev