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

John Layt jlayt at kde.org
Fri Mar 25 14:35:48 PDT 2016


On 25 March 2016 at 20:05, Eric Goddard <egoddard1010 at gmail.com> wrote:
> It looks like I can make sure most of the settings are configured
> properly using QSettings(), but still not sure how to go about opening
> the georeferencer with an image and the output and report fields
> pre-populated.

As far as I'm aware you can't, it's written as a separate C++ plugin
and none of the code is accessible via python, in particular launching
it with a given image. See
https://github.com/qgis/QGIS/tree/master/src/plugins/georeferencer for
the code. I wish the code was available via api calls and more
scriptable, I could sure use it myself.

For our own far simpler special use case when I had to georeference
3000 plans to preset grid points I wrote our own plugin gui to load
the images, set the gcp's and made the calls out to gdal directly
(reduced the effort from 42 clicks per image to just 6, so well worth
it). It could be adaptable to your use case, you can see the code at
https://github.com/lparchaeology/ArkPlan/tree/master/georef, feel free
to use any of it. You'd need to change it to have a single image view
that takes multiple gcp's, and then get the map points from the main
canvas (see https://github.com/lparchaeology/ArkPlan/blob/master/grid/grid_wizard.py
for how to do that), but it shouldn't take too much work.

If it is useful, let me know, I've been meaning to spin it off as it's
own plugin for some time and having another use case would justify the
effort in generalising it :-)

John.



More information about the Qgis-user mailing list