0

My plan is to download data from a WFS (https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetCapabilities) and to convert it to GeoJSON using ogr2ogr.

I ran

ogr2ogr -f GeoJSON dummy.geojson WFS:"https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32"

but received

ERROR 1: No schema information loaded
ERROR 1: No schema information loaded

The layer I am interested in is this one

<wfs:FeatureType xmlns:adv="http://www.adv-online.de/namespaces/adv/gid/6.0">
<wfs:Name>adv:AX_Flurstueck</wfs:Name>
<wfs:Title>adv_AX_Flurstueck</wfs:Title>
<wfs:DefaultCRS>urn:adv:crs:ETRS89_UTM32</wfs:DefaultCRS>
<wfs:OtherCRS>urn:adv:crs:ETRS89_Lat-Lon</wfs:OtherCRS>
<wfs:OtherCRS>urn:adv:crs:ETRS89_UTM33</wfs:OtherCRS>
<wfs:OtherCRS>urn:ogc:def:crs:EPSG::25832</wfs:OtherCRS>
<wfs:OtherCRS>urn:ogc:def:crs:EPSG::25833</wfs:OtherCRS>
<wfs:OtherCRS>urn:ogc:def:crs:EPSG::4258</wfs:OtherCRS>
<ows:WGS84BoundingBox>
<ows:LowerCorner>5.61272621360749 50.2373512077239</ows:LowerCorner>
<ows:UpperCorner>9.58963433710139 52.5286304537795</ows:UpperCorner>
</ows:WGS84BoundingBox>
</wfs:FeatureType>

but the link to the XML namespace (http://www.adv-online.de/namespaces/adv/gid/6.0) is dead.

What can I do?

2
  • namespace URIs don't have to resolve.
    – nmtoken
    Commented Jun 7, 2023 at 16:30
  • I think the issue you have is the adv:AX_Flurstueck featuretype is a complex feature, as shown in the DescribeFeatureType request: wfs.nrw.de/geobasis/…
    – nmtoken
    Commented Jun 7, 2023 at 16:39

1 Answer 1

0

If you turn debugging on (export CPL_DEBUG='ON') you get the following output

HTTP: Fetch(https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetCapabilities&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32)
HTTP: libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.14
WFS: No paging support
WFS: No ImplementsStandardJoins support
WFS: No transaction support
GDAL: GDALOpen(WFS:https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32, this=0x560468f8d750) succeeds as WFS.
GDAL: QuietDelete(/tmp/dummy.gpkg) invoking Delete()
GDAL: GDALDriver::Create(GPKG,/tmp/dummy.gpkg,0,0,0,Unknown,(nil))
HTTP: Fetch(https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=DescribeFeatureType&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32&TYPENAME=adv:AX_Flurstueck)
WFS: Turn off loading of multiple layer definitions at a single time
WFS: https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=DescribeFeatureType&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32&TYPENAME=adv:AX_Flurstueck
HTTP: Fetch(https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=DescribeFeatureType&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32&TYPENAME=adv:AX_Flurstueck)
WFS: https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32&COUNT=1
HTTP: Fetch(https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32&COUNT=1)
ERROR 1: No schema information loaded
NAS: Prescanning /vsimem/tempwfs_0x560468f85460/file.gml.
OGR: XMLPlatformUtils::Initialize()
NAS: 0 remaining classes after prescan.

GDAL: GDALOpen(/vsimem/tempwfs_0x560468f85460/file.gml, this=0x560469128470) succeeds as NAS.
NAS: Clearing classes.
OGR: XMLPlatformUtils::Terminate()
GDAL: GDALClose(/vsimem/tempwfs_0x560468f85460/file.gml, this=0x560469128470)
WFS: https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32
HTTP: Fetch(https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32)
ERROR 1: No schema information loaded
NAS: Prescanning /vsimem/tempwfs_0x560468f85460/file.gml.
OGR: XMLPlatformUtils::Initialize()
NAS: 0 remaining classes after prescan.

GDAL: GDALOpen(/vsimem/tempwfs_0x560468f85460/file.gml, this=0x5604696b24f0) succeeds as NAS.
GDALVectorTranslate: 0 features written in layer 'adv:AX_Flurstueck'
NAS: Clearing classes.
OGR: XMLPlatformUtils::Terminate()
GDAL: GDALClose(/vsimem/tempwfs_0x560468f85460/file.gml, this=0x5604696b24f0)
GDAL: GDALClose(WFS:https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32, this=0x560468f8d750)
GPKG: Creating insert/delete feature_count triggers
GDAL: GDALClose(/tmp/dummy.gpkg, this=0x5604692445e0)
GDAL: In GDALDestroy - unloading GDAL shared library.

The problem seems to be that the request for the first feature (which I suspect OGR uses to determine the schema of the features, even though it has the describeFeatureType result), doesn't return any features.

https://www.wfs.nrw.de/geobasis/wfs_nw_alkis_nas-konform?VERSION=2.0.0&SERVICE=WFS&REQUEST=GetFeature&TYPENAMES=adv:AX_Flurstueck&BBOX=254947.56504946592,5823118.597713644,332369.2140483765,5754509.447973528,urn:adv:crs:ETRS89_UTM32&COUNT=1

which gives me:

<?xml version="1.0" encoding="utf-8"?>
<wfs:FeatureCollection timeStamp="2023-06-07T18:14:57.606+02:00" numberReturned="0" numberMatched="unknown" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.adv-online.de/namespaces/adv/gid/6.0 http://www.wfs.nrw.de/aaa-suite/schema/NAS/6.0/schema/AAA-Fachschema.xsd http://www.opengis.net/wfs/2.0 http://www.wfs.nrw.de/aaa-suite/schema/ogc/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://www.wfs.nrw.de/aaa-suite/schema/NAS/6.0/schema/gml/3.2.1/gml.xsd http://www.isotc211.org/2005/gco http://www.wfs.nrw.de/aaa-suite/schema/NAS/6.0/schema/iso/19139/20070417/gco/gco.xsd http://www.isotc211.org/2005/gmd http://www.wfs.nrw.de/aaa-suite/schema/NAS/6.0/schema/iso/19139/20070417/gmd/gmd.xsd"/>

and hence the ERROR 1: No schema information loaded warning.

Interestingly adding the same server to QGis and inspecting the URLs it generates gives URLs with bounding boxes like:

BBOX=350341.30294873716775328,5703525.80467389803379774,350352.33451895019970834,5703536.83624411094933748,urn:ogc:def:crs:EPSG::25832

Which do work, so I would say the problem is that your bounding box/SRS is defined wrongly (or both).

3
  • Thank you very much @Ian for the help! Could you clarify what you mean by "SRS is defined wrongly"? For the SRS I used the wfs:DefaultCRS which is urn:adv:crs:ETRS89_UTM32 for adv:AX_Flurstueck. Could this be the problem? Do you know why QGIS is using urn:ogc:def:crs:EPSG::25832? For the coordinates of the BBOX I am actually still unsure since the order of the coordinates can (as I understand it) vary for different SRS/CRS.
    – GongFu
    Commented Jun 7, 2023 at 19:35
  • You can also use the ogr2ogr parameters [-spat xmin ymin xmax ymax] [-spat_srs srs_def] for defining the bounding box just in case if GDAL knows how to convert them into a working GetFeature request. GDAL may know if QGIS can read the service.
    – user30184
    Commented Jun 7, 2023 at 20:58
  • 1
    WFS: No paging support might be a killer too considering number of features numberMatched="9359426"
    – nmtoken
    Commented Jun 8, 2023 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.