The plugin for Dutch Spatial Zoning plans shows the effectiveness of an Open Source approach

Rececently the ruimtelijkeplannen plugin for using dutch spatial zoning plans in QGIS was renewed.

A lot of extra functionality was added, sponsored by LBP|SIGHT, a company which uses this plugin frequently.

As it happened, we now have a small list list of organizations who contributed to the development of this plugin, illustrating the power of the OpenSource model:

Select by location: what about those geometric predicates?

Currently, there’s around 20 persons in Bucharest working on QGIS development during the Contributors Meeting. And because the name of the hackfest is changed from developers meeting to contributors meeting, I now feel welcome too (as a non-coding contributor).

So what can I do, as a non-coding QGIS fan? Write documentation! I just started with some documentation that I really thought should be better. I even used it as a (bad) example in a presentation at the FOSS4GNL, titled “what we can learn from esri”. And I always say that with open source software, you are able to improve the stuff that you think is bad. So… I felt obligated to do so.

I hope that shortly the documentation for Select by Location is better then it used to be (I never understood the geometric predicates, and it was hardly explained in the docs), with an explanation using… an image and examples! ;-) A pull request is on it’s way. My first ever for QGIS docs…

And while I was at it, I made this small animated gif to show the most commonly used ones:

selectbylocation_operators

Writing documentation for QGIS is fun, but the github workflow is a bit strange for someone who is not used to code… But it can be done :-). If you need a hand, you can reach me at erik.meerburg@landgoed.it

Added: In the docs you will now see my first attempt on writing documentation in action: https://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vectorselection.html#select-by-location

Proj: Select Datum Transformations for EPSG:28992

(FOR REFERENCE, TODO: TO BE UPDATED AND TRANSLATED)

If you startup QGIS 3.8 / Zanzibar the first time to load a data in our national CRS (EPSG:28992) you are being presented with the following dialog:

projqgisveranderingen

I thought it had something todo with the fact that this OSGeo4W install maybe used the newer PROJ (6.0.1), but the About box of QGIS shows:

Compiled against PROJ5.2.0
Running against PROJ Rel. 5.2.0, September 15th, 2018

Checking my older version of QGIS I found the proj/Transformation string used there was:

Proj4: +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 +units=m +no_defs

The first item in the dialog looks most like it…

Strange thing is that the first item is colored GREEN, so it looks like that is the preferred or current one?

But reading the information (from PROJ), you see:

+towgs84=565.237,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812
EPSG Transformation Code: 15934
Source CRS: Amersfoort
Destination CRS: WGS 84
Remarks: Parameter values from Amersfoort to ETRS89(3) (tfm code 15739) assuming that ETRS89 is equivalent to QGS84 withing the accuracy of the transformation.
Replaces Amersfoort to WGS 84 (2) (code 1672)
Replaced by Amersfoort to WGS 84 (4) (tfm code 4833)

+towgs84=593.16,26.15,478.54,-1.3044,-0.1033,-1.1445,4.0775
EPSG Transformation Code: 1112
Source CRS: Amersfoort
Destination CRS: WGS 84
Remarks: Replaced by Amersfoort to WGS84 (2) (code 1672).

+towgs84=565.04,49.91,465.84,-0.409394,0.359705,-1.86849,4.0772
EPSG Transformation Code: 1672
Source CRS: Amersfoort
Destination CRS: WGS 84
Remarks: Parameter values from Amersfoort to ETRS89(1) (code 1751) assuming that ETRS89 is equivalent to WGS84 within the accuracy of the transformation. Replaces Amersfoort to WGS84 (1) (code 1112). Replaced by Amersfoort to WGS84 (3) (code 15934).

+towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725
EPSG Transformation Code: 4833
Source CRS: Amersfoort
Destination CRS: WGS 84
Remarks: Parameter values from Amersfoort to ETRS89(5) (tfm code 4830) assuming that ETRS89 is equivalent to WGS84 within the accuracy of the transformation.
Replaces Amersfoort to WGS84 (3) (code 15934).

So my preliminary conclusion now is: do not use the GREEN (top) one, but the last one, as that states: Replaces Amersfoort to WGS84 (3) (code 15934)..

Ok, Nyall answered my question on the mailing list.

It appears that the transformations QGIS used earlier was a little messy, and he advices lo look into QGIS with proj6. Funny thing is then you are shown just 2 options (again the first one green). I’ll have to compile projinfo to see what that gives…

screenshot-20190627104509-716x467

Anybody better information or reasoning?

QGISnetworklogger plugin or what are QGIS and my service talking about…

Just released a ‘new’ plugin:
QGIS Network Logger, install via the plugin manager of QGIS version 3.6 or higher (https://plugins.qgis.org/plugins/qgisnetworklogger/).

One of the things QGIS is pretty good in is talking to OGC services (WebMapService/WMS, WebFeatureService/WFS etc etc), QGIS even talks to Esri web services.
Something what was hard in this, is that if you are an average Windows user of QGIS, with a build without debug information, you were never able to see WHAT exactly QGIS was talking about with the server…
So when QGIS fails to show something on your map, it was not always clear if it was a data problem, a QGIS problem or ( very often :-) ) a service issue.

With this plugin, made possible by work of several core-devs in QGIS 3.6 or more, you can ‘justs’ see all the GET/POST/PUT/DELETE requests that QGIS is firing off to the servers. If you are a WebDeveloper: it even listens to F12 (for others: that is the key to show the web-console in most browsers, which also show you internal information of traffic and web pages).

There is a lot to see:

Information and context menu

You see all url’s being fired, the HTTP Operation, status, query, headers from Request and Reply and data/content from the Request etc etc.

You can even ‘replay’ or try out a request in your browser or terminal, by using the context menu on a url:

open

In this example you can see that you can copy a request as a CURL (https://curl.haxx.se/) command to fetch the data or image again.
OR if it is a GET url, you can just open it in your default browser.

The work was able because in QGIS 3.6 Nyall et al. changed some code, so it was easier to ‘listen’ to all the requests that QgsNetworkManager is doing. So this plugin just listens to the requests and show them in the window.

So as long as the provider (or plugin) is using the QgsNetworkManager interface to connect to online services, you will see the requests flying by in the logger window. I hope this is an argument for plugin builders to not use Requests anymore ;-), but stick to our own network machinery.

As said: this would not have been possible without help of Nyall and Alessandro. Nyall also helped with the treeview in my first rudimentary version.
That treeview also costs me some hair though. Because of the asynchrounous nature of the web, AND the fact that you can filter the requests, I bumped in all kind of threading issues…. The tree(view) is being filled, sorted, changed, updated etc etc so fast, that I suffered a lot of crashes… BUT I think I managed to make it stable now.

If not: let me know: https://github.com/rduivenvoorde/qgisnetworklogger/issues
Also if you want to pick up one of the Feature Requests we already have :-)

Happy QGISsing.

About Layer tree embedded widgets and have your WM(T)S always crispy sharp

Around 2014/2015 Martin updated the whole Legend / Layermanager code in QGIS. He wrote some nice blogs about this new “Layer Tree API”: Part 1, Part 2 and Part 3 so people would better understand how “to talk PyQGIS to the Legend”.

In 2016 Martin merged some code on top of this, which would make it possible to create so called ‘Layer Tree embedded widgets’.

In the image below you see an example of this: a little opacity slider which can be used there to change the opacity of the Layer to which it is connected visible in the Layer Manager.

Such embedded widgets are inserted when you move then in the Layer Properties/Legend tab from ‘Available widgets’ to ‘Used widgets’, ONLY for the layer you are viewing the properties.

embeddedwidget_gui

Continue reading About Layer tree embedded widgets and have your WM(T)S always crispy sharp