GDAL VRT – Using Virtual File System (VSI) as Data Source for Virtual Format

gdalvrt

I cant' make something like that work:

<OGRVRTDataSource>
    <OGRVRTLayer name="adresses-33">
        <SrcDataSource>/vsigzip//vsicurl/https://adresse.data.gouv.fr/data/ban/adresses/latest/csv/adresses-33.csv</SrcDataSource>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>EPSG:4326</LayerSRS>
    </OGRVRTLayer>
</OGRVRTDataSource>

Am I missing something or it's simply not possible to use VSI syntax as datasource in *.vrt files?

Best Answer

You need to change it to the following

<OGRVRTDataSource>
    <OGRVRTLayer name="adresses-33">
        <SrcDataSource>/vsigzip//vsicurl/https://adresse.data.gouv.fr/data/ban/adresses/latest/csv/adresses-33.csv.gz</SrcDataSource>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>EPSG:4326</LayerSRS>
        <GeometryField encoding="PointFromColumns" x="lon" y="lat"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

Considering a file debug.vrt with the above content, it's working using below command

ogrinfo -so -al debug.vrt

The changes made are

Related Question