Bug report #9377

WMS getfeatureinfo result dialog not rendered ok and disappears

Added by Richard Duivenvoorde about 10 years ago. Updated about 10 years ago.

Status:Closed
Priority:High
Assignee:Radim Blazek
Category:Web Services clients/WMS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17977

Description

Both in current testing and 2.0.1 (here on Debian), I have troubles with the WMS getfeatureinfo output.

It defaults to html, but the first time I do a getfeatureinfo (Identify Features) it seems there is info, but in the dialog it is not visbile (see infohtmlnok.png), then a second getfeatureinfo it looks ok (infohtmlok.png).

Switching to another type (eg text) that does not show anything at that moment (probably because it does not fire a new getfeatureinfo request with the new outputformat), which is understandable...

But if I switch to 'feature' and click in the map again, the featureinfo disappears (crashes) and does not show up again anymore for the wms. Switching to shp file identify features works, but going back to the wms layer does not show the featureinfo anymore. Only after a restart of QGIS it works again.

All here on Debian testing, fresh compile both 2.0.1 and master.

You can test by using this wsm: http://geodata.nationaalgeoregister.nl/weggeg/ows?
and selecting the maximum speedlimits on our highways: weggegmaximumsnelheden

infohtmlnok.png - first html output (32.6 KB) Richard Duivenvoorde, 2014-01-20 03:40 AM

infohtmlok.png - html output ok (61.2 KB) Richard Duivenvoorde, 2014-01-20 03:40 AM

infofeaturenok.png - feature output not ok (20.9 KB) Richard Duivenvoorde, 2014-01-20 03:40 AM

History

#1 Updated by Giovanni Manghi about 10 years ago

  • Affected QGIS version changed from 2.0.1 to master
  • Assignee set to Radim Blazek

#2 Updated by Radim Blazek about 10 years ago

  • Subject changed from WMS getfeatureinfo result dialog not rendered ok and 'crashing' to WMS getfeatureinfo result dialog not rendered ok and disappears

1) I have changed title from 'crashing' which was misleading to 'disappeares'.

2) Setting the height of QgsIdentifyResultsWebView (where HTML is displayed) is quiet delicate, see comments here

It seems that the height of parent is not available the first time (before the dialog was shown at least once) but that is known and it should not be important because the height of QgsIdentifyResultsWebView is set either to page content height if it is known when inserted (if there are no external sources like images) or to minimum height 100. The parent height is only used to limit max QgsIdentifyResultsWebView height.

It could be that the parent is already available but it does not have correct size yet. Please try to grep debug output for qgsidentifyresultsdialog.cpp and post here what sizes it prints when you identify with HTML format the first time.

I have tried to fix that setting always minimum height in 9784925

3) If format is changed it DOES resend the request. I can confirm however that the text is not visible if the dialog is not large enough. Try to enlarge the dialog window. I'll try to find the problem.

4) I confirm that "Feature" (GML) response is not parsed OK (problem in guessing GML schema.

5) When GML parsing does not return feature (but does not report error), it is really impossible to switch back. It will be probably better to always return a message like "no features found" (even it is different from vector layers) so that format may be switched.

#3 Updated by Richard Duivenvoorde about 10 years ago

This is the output I have now:


src/gui/qgsmaptoolidentify.cpp: 595: (identifyRasterLayer) 1 html or text values
src/app/qgsidentifyresultsdialog.cpp: 475: (addFeature) feature.isValid() = 0
src/providers/wms/qgswmsprovider.cpp: 3526: (capabilities) entering.
src/providers/wms/qgswmsprovider.cpp: 3539: (capabilities) 'weggegmaximumsnelheden' is queryable.
src/providers/wms/qgswmsprovider.cpp: 3565: (identifyCapabilities) capability = 896
src/providers/wms/qgswmsprovider.cpp: 3565: (identifyCapabilities) capability = 896
src/providers/wms/qgswmsprovider.cpp: 3552: (capabilities) capability = 928
src/app/qgsidentifyresultsdialog.cpp: 221: (loadFinished) Entered
src/app/qgsidentifyresultsdialog.cpp: 151: (sizeHint) content size: 540 x 319
src/app/qgsidentifyresultsdialog.cpp: 167: (sizeHint) parent widget height = 30 max height = 27
src/app/qgsidentifyresultsdialog.cpp: 178: (sizeHint) size: 100 x 27
src/app/qgsidentifyresultsdialog.cpp: 151: (sizeHint) content size: 540 x 319
src/app/qgsidentifyresultsdialog.cpp: 167: (sizeHint) parent widget height = 0 max height = 0
src/app/qgsidentifyresultsdialog.cpp: 178: (sizeHint) size: 100 x 0
src/app/qgsidentifyresultsdialog.cpp: 151: (sizeHint) content size: 540 x 319
src/app/qgsidentifyresultsdialog.cpp: 167: (sizeHint) parent widget height = 0 max height = 0
src/app/qgsidentifyresultsdialog.cpp: 178: (sizeHint) size: 100 x 0
src/app/qgsidentifyresultsdialog.cpp: 151: (sizeHint) content size: 540 x 319
src/app/qgsidentifyresultsdialog.cpp: 167: (sizeHint) parent widget height = 0 max height = 0
src/app/qgsidentifyresultsdialog.cpp: 178: (sizeHint) size: 100 x 0
src/app/qgscustomization.cpp: 806: (customizeWidget) objectName = QgsIdentifyResultsBase event type = 17
src/app/qgscustomization.cpp: 808: (customizeWidget) QgsIdentifyResultsDialog x QDialog
src/providers/wms/qgswmsprovider.cpp: 3526: (capabilities) entering.

I'll do a fresh build and test further

#4 Updated by Radim Blazek about 10 years ago

GML parser was fixed in 4d660d1.

You should now be able for example to query features, highlight geometry of selected feature (select feature in tree) and copy selected feature (button in bottom) and paste it as a new (memory) layer.

#5 Updated by Radim Blazek about 10 years ago

  • Status changed from Open to Closed
  • html height: 2a4f104 - the dialog is opened before items are inserted, that should allow them to justify height according to dialog size also the first time.
  • text: 3215f49 - web view is used also for plain text
  • dialog disappears if parsing GML failed: ee236d2 - additional check in WMS provider, error reported if feature types were guessed but no features parsed

That should be all I hope.

Also available in: Atom PDF