5

I downloaded one of files from https://use-land-property-data.service.gov.uk/datasets/inspire/download and I am trying to convert it to some friendlier format with ogr2ogr

I tried ogr2ogr -f "ESRI Shapefile" output.shp input.gml but ogr2ogr just sits there frozen.

How can I enable some verbose debug (I already figured out that .xml file downloaded from this website is actually a .zip archive)

In this case problem turned out to be ogr2ogr giving "ERROR 1: Failed connect to 192.168.4.18:8181; Operation timed out" error? - still some way to make ogr2ogr more verbose for future uses would be welcome.

Spacedman
  • 63,755
  • 5
  • 81
  • 115

2 Answers2

8

https://www.google.com/search?q=ogr2ogr+enable+debug+output send me to https://gdal.org/programs/vector_common_options.html which suggests:

--debug <value>

and says

Control what debugging messages are emitted. A value of ON will enable all debug messages. A value of OFF will disable all debug messages. Otherwise, a debug messege will be emitted if its category appears somewhere in the value string.

So try ogr2ogr --debug ON -f "ESRI Shapefile" output.shp input.gml.

For more information if remote services might be involved (GML is such a format, there are namespaces and whatnot that might make GDAL make network calls to remove servers) you can add --config CPL_CURL_VERBOSE YES (thanks @user30184 for the hint).

bugmenot123
  • 11,011
  • 3
  • 34
  • 69
3

It seems to be an issue with those datasets. I downloaded the one for Liverpool and got a similar issue to you. Having a poke inside the GML file, I found this line:

<wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:LR="www.landregistry.gov.uk" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="156026" numberReturned="156026" timeStamp="2022-10-02T02:51:49.265Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://192.168.4.19:5080/geoserver/schemas/wfs/2.0/wfs.xsd www.landregistry.gov.uk http://192.168.4.19:5080/geoserver/LR/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=LR%3APREDEFINED http://www.opengis.net/gml/3.2 http://192.168.4.19:5080/geoserver/schemas/gml/3.2.1/gml.xsd">

The upshot of this is that His Majesty's Land Registry has hard-coded the URLs for the schemas to point to their own internal servers! The first thing would be to let them know they've made a bit of a booboo. The next thing is to add the DOWNLOAD_SCHEMA=NO output option:

ogr2ogr -f "ESRI Shapefile" -oo DOWNLOAD_SCHEMA=NO foo.shp Land_Registry_Cadastral_Parcels.gml

MerseyViking
  • 14,543
  • 1
  • 41
  • 75