3

Does anyone know if it is possible to load a vector layer in QGIS (not stored in a RDBMS) from a URL/URI?

7

Yes.

Use the GDAL/OGR VSI (virtual file system) syntax. For a URI, you would use /vsicurl, for a zip you would use /vsizip and you can chain them together, for a zip URI you would use /vsizip//vsicurl (note double slash).

So to add the poly layers from:

https://raw.githubusercontent.com/OSGeo/gdal/master/autotest/ogr/data/poly.zip 
https://raw.githubusercontent.com/OSGeo/gdal/master/autotest/ogr/data/poly_non_conformant.gpkg

to QGIS (I have only tested in QGIS 3.0), you would use

/vsizip//vsicurl/https://raw.githubusercontent.com/OSGeo/gdal/master/autotest/ogr/data/poly.zip
/vsicurl/https://raw.githubusercontent.com/OSGeo/gdal/master/autotest/ogr/data/poly_non_conformant.gpkg

So open the Data Source Manager-Vector (or Layer-Add Layer-Add Vector Layer... (ctrl-shift-v) menu) and you can just paste in /vsizip//vsicurl/https://url/etc...

E.g

Zipped Shapefile enter image description here

Geopackage enter image description here

Edit: I've just found that you can simply paste the URI for a geopackage in the Add Vector Layer... dialog, you don't need /vsicurl/etc... but this doesn't work for zipped shapefiles.

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.