[Qgis-user] creating a python plugin to autopopulate some of the Georeferencer properties

John Layt jlayt at kde.org
Sat Mar 26 06:21:38 PDT 2016


On 26 March 2016 at 00:03, Eric Goddard <egoddard1010 at gmail.com> wrote:
> Awesome, thanks John. We have about the same number of images to georef so
> that will be a big help. I looked at the georeferencer code which is how I
> discovered that some of the properties were stored in QSettings. I'm not too
> familiar with c++ though, but since the qgis api can be used to do custom
> applications I was hoping for a constructor for the georeferencer that I
> could use.

I did look at forking the C++ georeferencer and adapting it, or
perhaps creating my own python bindings using SIP, but the thought of
having to maintain and install compiled versions for all three
platforms just seemed more hassle, even though I am a C++ developer.

Trying to think of hacky ways to do this you could trigger the
mActionRunGeoref QAction via QgisInterface.rasterMenu().actions(), but
that would only open the georeferencer, it wouldn't get you having the
right file preselected, there simply isn't an api or setting to do
that. I guess it would allow you to have a plugin that when clicked on
presets the settings you need (including directory) before launching
the georeferencer.

The ideal would be to move a lot of the code into the public api with
python bindings and have a processing plugin so it can be python
scriptable, but I just don't have the time to do that. One day the
poor usability will get too much though and I will fix it...

John.



More information about the Qgis-user mailing list