Ancestors

Toot

Written by Tom Chadwin on 2024-12-10 at 17:44

Can anyone point me towards a working example of using header_file in OGR to read some remote GeoJSON via /vsicurl? I've not got it to work yet, and haven't found a good example to follow, only the OGR docs (which I might be misreading).

=> More informations about this toot | More toots from tomchadwin@en.osm.town

Descendants

Written by Even Rouault on 2024-12-10 at 18:27

@tomchadwin

$ echo "foo:bar" > headers.txt

$ ogrinfo --config GDAL_HTTP_HEADER_FILE headers.txt http://example.com/my.geojson

=> More informations about this toot | More toots from EvenRouault@mastodon.social

Written by Tom Chadwin on 2024-12-10 at 18:52

@EvenRouault Thank you! So it's not:

ogrinfo -ro -al -so /vsicurl?header_file=headers.txt*url=https://example.com/my.geojson

or:

ogrinfo -ro -al -so /vsicurl?[header_file=headers.txt]*url=https://example.com/my.geojson

as per https://gdal.org/en/stable/user/virtual_file_systems.html#vsicurl-http-https-ftp-files-random-access?

=> More informations about this toot | More toots from tomchadwin@en.osm.town

Written by Even Rouault on 2024-12-10 at 19:08

@tomchadwin That's a possible alternative. But the '' in [foo=bar&] just means the options may be repeated 0 or multiple times.

So you want something like:

"/vsicurl?header_file=headers.txt&url=https://example.com/my.geojson"

=> More informations about this toot | More toots from EvenRouault@mastodon.social

Written by Tom Chadwin on 2024-12-11 at 09:34

@EvenRouault Thanks very much. It's failing - I had better ask a GIS.SE question, then rather than exploit your good will here, Even. Thanks again.

=> More informations about this toot | More toots from tomchadwin@en.osm.town

Written by Tom Chadwin on 2024-12-11 at 10:34

@EvenRouault Question asked here: https://gis.stackexchange.com/questions/488656/how-to-debug-a-failing-ogr-vsicurl-call

=> More informations about this toot | More toots from tomchadwin@en.osm.town

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113629769688779564
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
272.863378 milliseconds
Gemini-to-HTML Time
1.4644 milliseconds

This content has been proxied by September (ba2dc).