[gdal-dev] Read CSV from API with ogr2ogr

Anders Kragh Barfod (andb) andb at balk.dk
Tue Nov 15 11:03:29 PST 2016


Hi List.

I'm trying to convert a CSV to PostgreSQL with ogr2ogr, but the CSV is coming from an API:


http://api.statbank.dk/v1/data/FT/CSV?delimiter=Semicolon&HOVEDDELE=*&Tid=*

I have tried following ogr2ogr:

ogr2ogr -f PostgreSQL PG:"dbname=postgres host=localhost port=5432 user=postgres password=xxx" CSV:"/vsicurl/http://api.statbank.dk/v1/data/FT/CSV?delimiter=Semicolon&HOVEDDELE=*&Tid=*" -nln FT -lco SEPARATOR=SEMICOLON

But are getting: Unable to open data source....
I can get it working if I download the CSV and use ogr2ogr, but would prefer to fetch it straight from the API to reduce the steps in my script.

Thanks in advance.

Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161115/c7ff1a3c/attachment.html>


More information about the gdal-dev mailing list