<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.E-mailStijl17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=NL link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>I use QGIS on Windows10 which comes with GDAL. The latest QGIS LTR (3.40.14) uses GDAL 3.12.1<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>In QGIS I can open a terminal (browser panel, rightclick a folder and select Open in Terminal) and immediately use ogr2ogr to convert a WFS to a geopackage, because QGIS has altered the path to include the GDAL directory<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>However, with some WFS services ogr2ogr throws an error. I have no trouble using those WFS services in QGIS.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>For instance, this one I can’t convert:<o:p></o:p></span></p><p class=MsoNormal>ogr2ogr -f gpkg test.gpkg WFS:"https://service.pdok.nl/kadaster/bestuurlijkegebieden/wfs/v1_0?" Provincieg<span lang=EN-GB>ebied -overwrite -nln provincie_kadaster<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>But this one I can:<o:p></o:p></span></p><p class=MsoNormal>ogr2ogr -f gpkg test2.gpkg WFS:"https://map.data.amsterdam.nl/maps/gebieden" wijk -overwrite -nln amsterdam_wijk<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>The first WFS is part of a large Dutch open data organization and depending on which WFS I choose from them I see two different errors:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>ERROR 1: XML parsing of GML file failed : no element found at line 27, column 31065 (or different numbers)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Or<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>ERROR 1: XML parsing of GML file failed : unclosed token at line 555, column 9<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>I was able to compare a debug on with someone who was able to convert the WFS to a gpkg and this part was surely different<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ligatures:none;mso-fareast-language:NL'>VSICURL: Read attempt beyond end of file<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-ligatures:none;mso-fareast-language:NL'>VSICURL: Read attempt beyond end of file<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>After this, the error appeared.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>To make things more complicated:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>When I open a Windows Prompt (terminal) and set a path to the GDAL directory in QGIS using set PATH=%PATH%;C:\Program Files\QGIS 3.40.14\bin<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>I can also use ogr2ogr.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>Interestingly, now I can convert both WFS datasets to gpkg.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>What could be different with the QGIS Terminal setting from a Windows Prompt setting with the path set that would explain the errors?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>What might be different in both WFS services that triggers these errors?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-ligatures:none;mso-fareast-language:NL'>Kind regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-ligatures:none;mso-fareast-language:NL'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-ligatures:none;mso-fareast-language:NL'>Jeroen Hovens<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-ligatures:none;mso-fareast-language:NL'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-ligatures:none;mso-fareast-language:NL'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div></body></html>