qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.39k stars 2.98k forks source link

Network logger: missing WFS getFeature request #49332

Closed pathmapper closed 2 years ago

pathmapper commented 2 years ago

What is the bug or the crash?

Network logger: missing WFS getFeature request

Steps to reproduce the issue

  1. Add the following WFS connection to QGIS browser: https://xplanung.freiburg.de/xplansyn-wfs/services/xplansynwfs
  2. Open the network logger.
  3. Add the feature type: xplan:BP_Bereich
  4. See error: A layer with 9 features (number may vary) is added but for the network logger there are only getFeature-requests with RESULTTYPE=hits or COUNT=1, so the getFeature-request(s) for all 9 features is missing.

https://user-images.githubusercontent.com/20856381/178483200-ee986df7-814e-46c6-9dd9-c7880a580e19.mp4

Versions

QGIS version 3.27.0-Master QGIS code revision 876188b627
Qt version 5.12.8
Python version 3.8.10
GDAL/OGR version 3.0.4
PROJ version 6.3.1
EPSG Registry database version v9.8.6 (2020-01-22)
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
SQLite version 3.31.1
PostgreSQL client version 12.11 (Ubuntu 12.11-0ubuntu0.20.04.1)
SpatiaLite version 4.3.0a
QWT version 6.1.4
QScintilla2 version 2.11.2
OS version Ubuntu 20.04.4 LTS

Active Python plugins sagaprovider | 2.12.99 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99 db_manager | 0.1.20

Supported QGIS version

New profile

Additional context

No response

rduivenvoorde commented 2 years ago

I was curious, and tried to reproduce, but this (pretty slow) service, does not seem to return features?

Firing the 'getFeatures' url from the network logger: https://xplanung.freiburg.de/xplansyn-wfs/services/xplansynwfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=xplan:BP_Bereich&COUNT=1&SRSNAME=EPSG:4326 into a browser, I get:

<?xml version='1.0' encoding='UTF-8'?>
<wfs:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.deegree.org/xplanung/1/0 http://xplanung.freiburg.de/xplansyn-wfs/services/xplansynwfs?SERVICE=WFS&amp;VERSION=2.0.0&amp;REQUEST=DescribeFeatureType&amp;OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&amp;TYPENAME=xplan:BP_Bereich&amp;NAMESPACES=xmlns(xplan,http%3A%2F%2Fwww.deegree.org%2Fxplanung%2F1%2F0)" xmlns:wfs="http://www.opengis.net/wfs/2.0" timeStamp="2022-07-18T14:38:40Z" xmlns:gml="http://www.opengis.net/gml/3.2" numberMatched="unknown" numberReturned="0">
  <!--NOTE: numberReturned attribute should be 'unknown' as well, but this would not validate against the current version of the WFS 2.0 schema (change upcoming). See change request (CR 144): https://portal.opengeospatial.org/files?artifact_id=43925.-->
  <wfs:member>
    <xplan:BP_Bereich xmlns:xplan="http://www.deegree.org/xplanung/1/0" gml:id="XPLAN_BP_BEREICH_4910f383-3581-4315-a210-be7286716c6a">
      <xplan:gmlId>XPLAN_BP_BEREICH_4910f383-3581-4315-a210-be7286716c6a</xplan:gmlId>
      <xplan:xpVersion>5.2</xplan:xpVersion>
      <xplan:xpPlanType>BP_Plan</xplan:xpPlanType>
      <xplan:xpPlanName>Hansastraße (neu)</xplan:xpPlanName>
      <xplan:xplanMgrPlanId>34</xplan:xplanMgrPlanId>
      <xplan:nummer>0</xplan:nummer>
      <xplan:gehoertZuPlan>[XPLAN_BP_PLAN_474439d0-eff0-4986-b53d-426d7455b930]</xplan:gehoertZuPlan>
    </xplan:BP_Bereich>
  </wfs:member>
</wfs:FeatureCollection>

which to me does not look like something QGIS should be able to create a geometry from?

pathmapper commented 2 years ago

does not seem to return features?

It's returning features but features with no geometry :)

like something QGIS should be able to create a geometry from?

There's no need for a geometry, QGIS would create a layer with features without geometry.

The issue here is that the network logger doesn't show the request(s) for all features, e.g. without paging this should be something like:

https://xplanung.freiburg.de/xplansyn-wfs/services/xplansynwfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=xplan:BP_Bereich&SRSNAME=EPSG:4326

rduivenvoorde commented 2 years ago

I'm testing this on a slightly older master, and QGIS IS indeed returning geometries... But what I see:

BUT if you then open the attribute table, THEN QGIS (and with me the networklogger) will show you an url with &COUNT=15000

gnome-shell-screenshot-c8oini

(now also tested in master build of today)

So.. we're good :-) ?

pathmapper commented 2 years ago

Ah, the request not fired until the attribute table is opened, nice spot :+1:

So.. we're good :-) ?

Well, for this issue I think yes, because the request is not missing, it's only fired later compared to layers with features which are having geometries.

It could be that this causes other issues, currently some processing tools are failing for me on such a layer...

Closing here :-)