Re: [gdal-dev] OAPIF with Accept-encoding: gzip

2021-03-23 Thread Even Rouault

Hi Jukka,

Accept-Encoding: gzip is actually sent by default as you can see with 
"ogrinfo 
OAPIF:"https://beta-paikkatieto.maanmittauslaitos.fi/inspire-buildings/features/v1/collections/building/"; 
--debug on --config CPL_CURL_VERBOSE YES", and the server honors it:


[...]

GET 
/inspire-buildings/features/v1/collections/building/items?f=json&limit=10 
HTTP/1.1

Host: beta-paikkatieto.maanmittauslaitos.fi
Accept-Encoding: gzip
Accept: application/geo+json, application/json

< HTTP/1.1 200 OK
[...]
< Content-Encoding: gzip
< Content-Type: application/geo+json

Curl automatically uncompress the data, so this is transparent for GDAL.

The debug trace "HTTP: These HTTP headers were set" is a bit misleading 
as it only displays the HEADERS option sent to CPLHttpFetch(), but not 
the content of what is specified with the GDAL_HTTP_HEADER_FILE config 
option. Enabling Curl traces with CPL_CURL_VERBOSE=YES is the ultimate 
way of seeing what is really sent to the server.


Even


Le 23/03/2021 à 13:21, Rahkonen Jukka (MML) a écrit :


Hi,

Is it possible to ask the OAPIF server to send response as gzipped, 
and if it succeeds, would GDAL know what to do with the response? I 
made a try by saving a line “Accept-Encoding: gzip" as a test file and 
then making this request:


ogrinfo 
OAPIF:"https://beta-paikkatieto.maanmittauslaitos.fi/inspire-buildings/features/v1/collections/building/"; 
--config GDAL_HTTP_HEADER_FILE headers.txt --debug on --config 
cpl_debug on


Unfortunately it seems that Accept-Encoding header was not added:

HTTP: These HTTP headers were set: Accept: application/geo+json, 
application/json


Is there some trick to make this to work or would it require changes 
into the OAPIF driver?


-Jukka Rahkonen-


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--
http://www.spatialys.com
My software is free, but my time generally not.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] OAPIF with Accept-encoding: gzip

2021-03-23 Thread Rahkonen Jukka (MML)
Hi,

Is it possible to ask the OAPIF server to send response as gzipped, and if it 
succeeds, would GDAL know what to do with the response? I made a try by saving 
a line "Accept-Encoding: gzip" as a test file and then making this request:

ogrinfo 
OAPIF:"https://beta-paikkatieto.maanmittauslaitos.fi/inspire-buildings/features/v1/collections/building/";
 --config GDAL_HTTP_HEADER_FILE headers.txt --debug on --config cpl_debug on

Unfortunately it seems that Accept-Encoding header was not added:
HTTP: These HTTP headers were set: Accept: application/geo+json, 
application/json

Is there some trick to make this to work or would it require changes into the 
OAPIF driver?

-Jukka Rahkonen-
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev