<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Richard,</p>
    <p>This is not related with Bernd's problem, but I think you found a
      bug. Thanks for testing.<br>
    </p>
    <p>If you change QgsRaster.IdentifyFormatFeature to
      IdentifyFormatHtml or IdentifyFormatText you get a valid result.</p>
    <p>result = l.dataProvider().identify(
      QgsPointXY(146153.5,456404.4), <br>
                   QgsRaster.IdentifyFormatHtml )             <br>
      print(result.isValid())<br>
      print(result.results()[0])</p>
    <p>You will get:</p>
    <p><body><br>
          <table class="featureInfo"><br>
              <caption
      class="featureInfo">Bebouwing</caption><br>
              <tr><br>
                  <th>objectBeginTijd</th><br>
                  <th>LV-publicatiedatum</th><br>
                  <th>relatieveHoogteligging</th><br>
                  <th>inOnderzoek</th><br>
                  <th>tijdstipRegistratie</th><br>
                  <th>identificatieNamespace</th><br>
                  <th>identificatieLokaalID</th><br>
                  <th>bronhouder</th><br>
                  <th>bgt-status</th><br>
                  <th>plus-status</th><br>
                  <th>identificatieBAGPND</th><br>
              </tr><br>
              <tr><br>
                  <td>2016-08-22</td><br>
                  <td>2017-03-11T17:14:11</td><br>
                  <td>0</td><br>
                  <td>false</td><br>
                  <td>2016-08-22T15:38:22.000</td><br>
                  <td>NL.IMGeo</td><br>
                 
      <td>G0355.43ae8cce36d745a199bf13faf157fe74</td><br>
                  <td>G0355</td><br>
                  <td>bestaand</td><br>
                  <td>geenWaarde</td><br>
                  <td>0355100000721710</td><br>
              </tr><br>
          </table><br>
          <br/><br>
      </body><br>
    </p>
    <p>For some reason, the identify() is not creating the result set
      properly with the format QgsRaster.IdentifyFormatFeature.</p>
    <p>It seems like a bug, according to the documentation [1]. It is
      working on the GUI. The results are properly collected by QGIS
      from the remote WMS and displayed in the info panel.<br>
    </p>
    <p>Let's see if some else has trouble using this API call.</p>
    <p>Regards,</p>
    <p>Jorge<br>
    </p>
    <p>[1]
<a class="moz-txt-link-freetext" href="https://qgis.org/pyqgis/master/core/QgsRasterIdentifyResult.html#qgis.core.QgsRasterIdentifyResult.results">https://qgis.org/pyqgis/master/core/QgsRasterIdentifyResult.html#qgis.core.QgsRasterIdentifyResult.results</a></p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Às 13:07 de 19/10/20, Richard
      Duivenvoorde escreveu:<br>
    </div>
    <blockquote type="cite"
      cite="mid:3ed9e71d-0b47-07ec-1d4f-5c5f722da391@duif.net">
      <pre class="moz-quote-pre" wrap="">Hi Jorge, Bernd,

I thought to play with that, but ...

although I get a valid result, I cannot get to the actual features in python:

TypeError: unable to convert a C++ 'QgsFeatureStoreList' instance to a Python object

So I'm not sure if you could (currently) easily come to the actual feature...


What I did (working with a national buildings WMS, and a (to me) known valid x,y,width/height etc:

l=qgis.utils.iface.addRasterLayer(
"crs=EPSG:28992&layers=Bebouwingvlak&styles=&format=image/png&url=<a class="moz-txt-link-freetext" href="https://geodata.nationaalgeoregister.nl/kadastralekaart/wms/v4_0">https://geodata.nationaalgeoregister.nl/kadastralekaart/wms/v4_0</a>?", # uri
"buildings", # name for layer (as seen in QGIS)
"wms" # dataprovider key
)

result = l.dataProvider().identify( QgsPointXY(104606,490213), 
             QgsRaster.IdentifyFormatFeature, 
             QgsRectangle(104391.1406077263819,490161.0749502293766,104899.6563292678911,490283.3410253541078),
             1465,
             352,
             96)
print(result.isValid()) # prints True
print(result.results())
# prints TypeError: unable to convert a C++ 'QgsFeatureStoreList' instance to a Python object

Regards,

Richard Duivenvoorde

PS @Bernd: you are sure there is no WFS running there (if it is a Geoserver instance, it often has (silently) also a WFS....)?

On 10/19/20 1:36 PM, Jorge Gustavo Rocha wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Hi Bernd,

Try rlayer.dataProvider().identify()

Checks the docs at <a class="moz-txt-link-freetext" href="https://docs.qgis.org/3.10/en/docs/pyqgis_developer_cookbook/raster.html#query-values">https://docs.qgis.org/3.10/en/docs/pyqgis_developer_cookbook/raster.html#query-values</a>

Good luck,

Jorge

Às 12:25 de 19/10/20, Bernd Vogelgesang escreveu:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Hi there,

unfortunately I am provided with data only in form of a WMS layer
representing areas as polygons.
These areas match with the cadastral boundaries.
I am looking for a way how to hand over the data from the WMS to my
cadastral units to be able to really work with these informations.

I created a "Point on surface" layer of the cadastre.
Is there any pythonic or other way to "mimic" the "Identify features"
click on that layer with the coordinates of those points and store the
results?

I assume, that each click is a server request, so running these (in my
case) 8000 "cĺicks" should not be sent in a millisecond, but with some
pause.
It doesn't really matter how long this takes, cause it only has to be
done once and would be in any case faster than manually clicking and
noting the data.

Obviously, this is not what the provider of the data intends, but it's
like an act of self-defence against a stubborn and bureaucratic
administration.
So, data rebels, come to help please ;)

Cheers,

Bernd

_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">-- 
Email Signature
Logo <a class="moz-txt-link-rfc2396E" href="https://www.geomaster.pt"><https://www.geomaster.pt></a>      
*Geomaster*
*Jorge Gustavo Rocha* | Software Engineer
*e:*jgr@geomaster.pt | *m:*+351 910 333 888
*g:*41.54094,-8.40490 | *v: *510 906 109
*a: * Rua António Cândido Pinto, 67, 4715-400 Braga


_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>

</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
    <div class="moz-signature">-- <br>
      <title>Email Signature</title>
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <table style="width: 525px; font-size: 11pt; font-family: Arial,
        sans-serif;" cellspacing="0" cellpadding="0">
        <tbody>
          <tr>
            <td style="text-align:center; font-size: 10pt; font-family:
              Arial, sans-serif; border-right: 1px solid;
              border-right-color: #fb6303; width: 125px; padding-right:
              10px; vertical-align: top;" rowspan="6" width="125"
              valign="top"> <a href="https://www.geomaster.pt"
                target="_blank"><img alt="Logo" style="width:105px;
                  height:auto; border:0;"
src="https://geomaster.pt/wp-content/uploads/2017/02/cropped-geomaster300x300-1.png"
                  width="85" border="0"></a> </td>
            <td style="padding-left:10px">
              <table cellspacing="0" cellpadding="0">
                <tbody>
                  <tr>
                    <td style="font-size: 10pt; color:#0079ac;
                      font-family: Arial, sans-serif; width: 400px;
                      padding-bottom: 5px; padding-left: 10px;
                      vertical-align: top;" valign="top"> <strong><span
                          style="font-size: 14pt; font-family: Arial,
                          sans-serif; color:#fb6303;">Geomaster</span></strong><br>
                      <strong><span style="font-size: 11pt; font-family:
                          Arial, sans-serif; color:black;">Jorge Gustavo
                          Rocha</span></strong> <span
                        style="font-family: Arial, sans-serif;
                        font-size:11pt; color:#000000;"><span
                          style="padding-right: 5px; padding-left: 5px;">
                          | </span>Software Engineer</span> </td>
                  </tr>
                  <tr>
                    <td style="font-size: 10pt; color:#444444;
                      font-family: Arial, sans-serif; padding-bottom:
                      5px; padding-top: 5px; padding-left: 10px;
                      vertical-align: top; line-height:17px;"
                      valign="top"> <span><span style="color: #fb6303;"><strong>e:</strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000;"> <a class="moz-txt-link-abbreviated" href="mailto:jgr@geomaster.pt">jgr@geomaster.pt</a></span></span>
                      <span><span style="padding-left:
                          5px;padding-right: 5px;"> | </span><span
                          style="color: #fb6303;"><strong>m:</strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000;"> +351 910 333 888<br>
                        </span></span> <span><span style="color:
                          #fb6303;"><strong>g:</strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000;"> 41.54094,-8.40490</span></span>
                      <span><span style="padding-left:
                          7px;padding-right: 5px;"> | </span><span
                          style="color: #fb6303;"><strong>v: </strong></span><span
                          style="font-size: 10pt; font-family: Arial,
                          sans-serif; color:#000000; padding-left: 7px;">
                          510 906 109<br>
                        </span></span> <span> <span style="color:
                          #fb6303;"><strong>a: </strong></span> </span>
                      <span> <span style="font-size: 10pt; font-family:
                          Arial, sans-serif; color: #000000;"><span> </span>Rua
                          António Cândido Pinto, 67, 4715-400 Braga<br>
                        </span></span> </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>