[QGIS-Developer] QgsLocator & common python libs

Richard Duivenvoorde rdmailings at duif.net
Wed Apr 4 12:06:24 PDT 2018


Devs & Python devs,

I've written one plugin, which when installed adds 3 QLocator filters to
your little search-bar in the lower left corner of QGIS3:
- a Nominatim geocoder/filter
- a Google geocoder/filter
- a PDOK (dutch) geocoder/filter

The use of these geocoders/locators in QGIS is REALLY usefull, just
search for 'eiffel', and google will let you zoom to the eiffeltower
(even being written in dutch, french or german....)

The nominatim geocoder is also great, and the dutch geocoder can fly
over NL with just a zip+housenumber.

Code is here:
https://github.com/rduivenvoorde/qgislocator
Plugin zip to install is here:
https://github.com/rduivenvoorde/qgislocator/raw/master/qgislocator_0.1.1.zip

Now my main point: I discussed this with Nyall, if we should create a
mega-locator-plugin or keep the locator filter/plugins small.
Adding a geocoder to the current form is easy: just reimplement a filter
(see locatorfilters) for your national geocoder service, and you are done.

The advantage of having ONE mega-plugin:
- it is easy to have some 'basefilter' in which to have some common coce
- having one plugin, forces devs to use QgsNetworkRequest (here via
Alessandro's QgsNetworkAccessManager. So no more use of httplib2,
Requests etc which fail on proxied environments if not fully implemented).

BUT, it is probably better if we split up all the possible
locatorfilters (not everybody on the world is interested in dutch
addresses :-) ...

So my main point:
- how to give everybody the possibilty to implement a locator class, BUT
also share a common base class or use the same QgsNetworkAccessManager
moduel?

Some options:
- we create a separate repo for 'common' python classes, and via git
submodules everybody pulls in it's own copy of those classes
- we create a common-qgis-python module which would ship with QGIS (with
filterbaseclass, QgsNetworkAccessManager, and other ideas from the
Boundless commons lib).

Let me know any opinions/ideas.

Regards,

Richard Duivenvoorde

PS, wannatry? Download
https://github.com/rduivenvoorde/qgislocator/raw/master/qgislocator_0.1.1.zip
and use Install from ZIP in the plugin manager. Use '2022zj' to search
PDOK, or 'eiffel' to search Google. Note that you may need a google key
to use their geocoder.




More information about the QGIS-Developer mailing list