<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Thanks for your answer.<br>
<br>
The url works fine in a browser.<br>
<br>
Here is what "ogrinfo --debug on" returns :<br>
<blockquote type="cite">GDAL: Auto register C:\Program Files\QGIS
3.16.16\bin\gdalplugins\gdal_ECW_JP2ECW.dll using
GDALRegister_ECW_JP2ECW.<br>
GDAL: Auto register C:\Program Files\QGIS
3.16.16\bin\gdalplugins\gdal_GEOR.dll using GDALRegister_GEOR.<br>
GDAL: Auto register C:\Program Files\QGIS
3.16.16\bin\gdalplugins\gdal_HDF5.dll using GDALRegister_HDF5.<br>
GDAL: Auto register C:\Program Files\QGIS
3.16.16\bin\gdalplugins\gdal_MG4Lidar.dll using
GDALRegister_MG4Lidar.<br>
GDAL: Auto register C:\Program Files\QGIS
3.16.16\bin\gdalplugins\gdal_MrSID.dll using GDALRegister_MrSID.<br>
GDAL: Auto register C:\Program Files\QGIS
3.16.16\bin\gdalplugins\ogr_OCI.dll using RegisterOGROCI.<br>
GDAL: Auto register C:\Program Files\QGIS
3.16.16\bin\gdalplugins\ogr_SOSI.dll using RegisterOGRSOSI.<br>
HTTP: Fetch(<a class="moz-txt-link-freetext" href="http://mydomain:3000/rpc/wod_geojson.json">http://mydomain:3000/rpc/wod_geojson.json</a>)<br>
HTTP: libcurl/7.75.0 OpenSSL/1.1.1l zlib/1.2.11 WinIDN<br>
HTTP: These HTTP headers were set: Accept: text/plain,
application/json<br>
ERROR 1: HTTP error code : 404<br>
HTTP: Fetch(<a class="moz-txt-link-freetext" href="http://mydomain:3000/rpc/wod_geojson.json">http://mydomain:3000/rpc/wod_geojson.json</a>)<br>
HTTP: These HTTP headers were set: Accept: text/plain,
application/json<br>
ERROR 1: HTTP error code : 404<br>
FAILURE:<br>
Unable to open datasource
`<a class="moz-txt-link-freetext" href="http://sigeal.net:3000/rpc/wod_geojson.json">http://sigeal.net:3000/rpc/wod_geojson.json</a>' with the following
drivers...</blockquote>
<br>
Weird<br>
<br>
<pre class="moz-signature" cols="72">--
Christophe Damour
</pre>
<div class="moz-cite-prefix">Le 14/02/2022 à 20:26, Rahkonen Jukka
(MML) a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:275baf817c82465585b10671af0f87ce@maanmittauslaitos.fi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}h3
{mso-style-priority:9;
mso-style-link:"Otsikko 3 Char";
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:13.5pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}h4
{mso-style-priority:9;
mso-style-link:"Otsikko 4 Char";
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}h5
{mso-style-priority:9;
mso-style-link:"Otsikko 5 Char";
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}code
{mso-style-priority:99;
font-family:"Courier New";}pre
{mso-style-priority:99;
mso-style-link:"HTML-esimuotoiltu Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}span.Otsikko3Char
{mso-style-name:"Otsikko 3 Char";
mso-style-priority:9;
mso-style-link:"Otsikko 3";
font-family:"Calibri Light",sans-serif;
color:#1F3763;}span.Otsikko4Char
{mso-style-name:"Otsikko 4 Char";
mso-style-priority:9;
mso-style-link:"Otsikko 4";
font-family:"Calibri Light",sans-serif;
color:#2F5496;
font-style:italic;}span.Otsikko5Char
{mso-style-name:"Otsikko 5 Char";
mso-style-priority:9;
mso-style-link:"Otsikko 5";
font-family:"Calibri Light",sans-serif;
color:#2F5496;}span.HTML-esimuotoiltuChar
{mso-style-name:"HTML-esimuotoiltu Char";
mso-style-priority:99;
mso-style-link:HTML-esimuotoiltu;
font-family:Consolas;}span.Shkpostityyli25
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US">Does <a
href="http://mydomain:3000/rpc/wod_geojson.json"
moz-do-not-send="true" class="moz-txt-link-freetext">
http://mydomain:3000/rpc/wod_geojson.json</a> return data
if you send it with browser? Re-run the ogrinfo command
with “--debug on” and see if you can capture the http
requests that ogrinfo sends.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">Lähettäjä:</span></b><span
lang="EN-US"> gdal-dev
<a class="moz-txt-link-rfc2396E" href="mailto:gdal-dev-bounces@lists.osgeo.org"><gdal-dev-bounces@lists.osgeo.org></a>
<b>Puolesta </b>SIGéal<br>
<b>Lähetetty:</b> maanantai 14. helmikuuta 2022 20.54<br>
<b>Vastaanottaja:</b> <a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> [gdal-dev] Can't open postgrest service
with ogr2ogr (via QGIS)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">Hi list,<br>
<br>
I have a PostgreSql stored procedure which returns a geojson
feature collection created with json_build_object function.
This web service opens fine in OpenLayers, however, when I try
to open it in QGIS, with data source manager -> vector
-> protocol -> geojson.<br>
<br>
A similar REST service served with pg_featureserv, works
well...<o:p></o:p></p>
<h3>Here are tests realised with curl and ogrinfo for failing
postgrest service and working pg_featureserv services :<o:p></o:p></h3>
<h4>PostGrest<o:p></o:p></h4>
<h5>curl answer :<o:p></o:p></h5>
<div>
<pre><code>StatusCode : 200<o:p></o:p></code></pre>
<pre><code>StatusDescription : OK<o:p></o:p></code></pre>
<pre><code>Content : {123, 34, 116, 121...}<o:p></o:p></code></pre>
<pre><code>RawContent : HTTP/1.1 200 OK<o:p></o:p></code></pre>
<pre><code> Transfer-Encoding: chunked<o:p></o:p></code></pre>
<pre><code> Content-Range: 0-0/*<o:p></o:p></code></pre>
<pre><code> Vary: Accept-Encoding<o:p></o:p></code></pre>
<pre><code> Content-Type: application/geo+json<o:p></o:p></code></pre>
<pre><code> Date: Sun, 13 Feb 2022 07:35:55 GMT<o:p></o:p></code></pre>
<pre><code> Server: postgrest/9.0.0<o:p></o:p></code></pre>
<pre><code> <o:p></o:p></code></pre>
<pre><code> {"type" : ...<o:p></o:p></code></pre>
<pre><code>Headers : {[Transfer-Encoding, chunked], [Content-Range, 0-0/*], [Vary, Accept-Encoding], [Content-Type, <o:p></o:p></code></pre>
<pre><code> application/geo+json]...}<o:p></o:p></code></pre>
<pre><code>RawContentLength : 430979<o:p></o:p></code></pre>
</div>
<h5>ogrinfo answer :<o:p></o:p></h5>
<div>
<pre><code>ERROR 1: HTTP error code : 404<o:p></o:p></code></pre>
<pre><code>ERROR 1: HTTP error code : 404<o:p></o:p></code></pre>
<pre><code>FAILURE:<o:p></o:p></code></pre>
<pre><code>Unable to open datasource `<a href="http://mydomain:3000/rpc/wod_geojson.json" moz-do-not-send="true" class="moz-txt-link-freetext">http://mydomain:3000/rpc/wod_geojson.json</a>' with the following drivers...<o:p></o:p></code></pre>
</div>
<h4>pg_featureserv<o:p></o:p></h4>
<h5>curl answer :<o:p></o:p></h5>
<div>
<pre><code>StatusCode : 200<o:p></o:p></code></pre>
<pre><code>StatusDescription : OK<o:p></o:p></code></pre>
<pre><code>Content : {123, 34, 116, 121...}<o:p></o:p></code></pre>
<pre><code>RawContent : HTTP/1.1 200 OK<o:p></o:p></code></pre>
<pre><code> Transfer-Encoding: chunked<o:p></o:p></code></pre>
<pre><code> Content-Type: application/geo+json<o:p></o:p></code></pre>
<pre><code> Date: Sun, 13 Feb 2022 07:33:51 GMT<o:p></o:p></code></pre>
<pre><code> <o:p></o:p></code></pre>
<pre><code> {"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Po...<o:p></o:p></code></pre>
<pre><code>Headers : {[Transfer-Encoding, chunked], [Content-Type, application/geo+json], [Date, Sun, 13 Feb 2022 <o:p></o:p></code></pre>
<pre><code> 07:33:51 GMT]}<o:p></o:p></code></pre>
<pre><code>RawContentLength : 4474<o:p></o:p></code></pre>
</div>
<h5>ogrinfo answer :<o:p></o:p></h5>
<div>
<pre><code>INFO: Open of `<a href="http://mydomain:9000/functions/webmapod_mdarret/items.json" moz-do-not-send="true" class="moz-txt-link-freetext">http://mydomain:9000/functions/webmapod_mdarret/items.json</a>'<o:p></o:p></code></pre>
<pre><code> using driver `GeoJSON' successful.<o:p></o:p></code></pre>
<pre><code>1: items (Point)<o:p></o:p></code></pre>
</div>
<p>What could explain that 404 error for posgrest geojson web
service ?<o:p></o:p></p>
<p>Thanks for any hint,<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Christophe Damour<o:p></o:p></pre>
</div>
</blockquote>
<br>
</body>
</html>