[Qgis-user] Programmatically extract WMS data based on point layer?

Bernd Vogelgesang bernd.vogelgesang at gmx.de
Mon Oct 19 08:26:27 PDT 2020


On 19.10.20 17:17, Richard Duivenvoorde wrote:
> On 10/19/20 4:51 PM, Bernd Vogelgesang wrote:
>> I now dared to have a closer look at your findings.
>>
>> On 19.10.20 15:17, Richard Duivenvoorde wrote:Or in plain/text (VERY
>> ugly formatted!):
>>> https://www.lfu.bayern.de/gdi/wms/natur/oefk?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=5330491.99535488616675138,3656773.87868417054414749,5332123.06480348203331232,3661911.92747698817402124&CRS=EPSG:31467&WIDTH=1427&HEIGHT=453&LAYERS=oekoflaechen&STYLES=&FORMAT=image/jpeg&QUERY_LAYERS=oekoflaechen&INFO_FORMAT=text/plain&I=544&J=361&FEATURE_COUNT=10
>>>
>>> So theoretically you could create some script to just fire the GetFeatureInfo-requests. Main drawback is for a request to be valid, your bbox and width/height should be in par with your x,y (mmm, ArcGis apparently uses I J, which are pixels! in the bbox/width/height)... So I think that is pretty difficult.
>>>
>> errm, does the I and J represent the pixel at the coordinate relative to
>> the bbox? And how did you figure out the values?
> Well, that is why PyQGIS (and a script within QGIS) would come in handy, because there you can translate pixel to coordinates and back, AND the canvas
I have nothing against PyQGIS, I simple don't know how to use it ;)
>
> I just copied an url from the QGIS networkdebug dialog (F12).
>
> But honestly I think this is bad use of the WMS-api... you will not make friends with them :-)
For sure. But as I tried to explain, that would be just an act of self
defense against an adminstration sitting on their (our!) data like a hen.
>
> Regards,
>
> Richard
Ok, too much of your time wasted already.

Thanx,

Bernd



More information about the Qgis-user mailing list