2

My goal is it to write a plugin, that automates the print composition. The idea is that you choose the scale and the paper size and based on that a map with legend, north arrow and block title is produced. The legend should only show the active layers. The finished map should not be automatically saved. Instead the print composer window should open so that the user can change things manually afterwards. I read the PyGIS cookbook and the PyGIS Programmer's Guide however there wasn't much information about the automation of the print composer.

What I want to know is, if it is generally possible to write a plugin that does this stuff? If it is possible, where do I find more information about automating and programming the print composer? Or does anyone know a tool that does something similar so I don't have to write my own tool?

  • 1
    Welcome to GIS:SE @f1nan! In QGIS, go to the menubar: Plugins > Manage and Install Plugins and search for composer. You should see a list of available plugins online which you can download. Install a few, test them out, and check their source code from the C:/Users/You/.qgis2/python/plugins/ directory. – Joseph Dec 6 '16 at 10:46
  • I create thousands of maps in QGIS per year and it is not clear to me how your plugin would help me more than the standard template where I have map window, legend, title block, north arrow, scale bar etc. Adjusting template manually really doesn't take much, as far as I know legend is automatically populated by active layers when on auto update. But maybe I am missing something :) – Miro Dec 6 '16 at 10:46
  • I've already checked some of the composer plugins. However none of those plugins show the finished map in the composer window. At work we have projects with lots of layers and features. Thats why the legend ususally doesn't fit on the paper and has to be formatted manually. – f1nan Dec 6 '16 at 11:05
  • Seriously, have you tried to work with templates? You say you will need to update legend manually anyway and I guess there would be some other things you would have to manually update too. I still do not get what would be the benefit of this plugin compared to preset template where in few clicks you set map extent/scale, the scale bar linked to map adjusts automatically, legend is automatically autopopulated with active layers, even date etc. is possible to have automatically updated in the template... – Miro Dec 6 '16 at 11:54
  • The draftsmen at my engineering office are already using templates. I was asked to automate the process even more. Again the idea is to create a complete map based on a few given parameters. The finished map should be loaded into the map composer so that the draftsmen are able to change the stuff that is off (and only if it is off). Of course a plugin of this sort would be relativeley special and serve the only purpose of making the life of my coworkers easier. If this can be done with templates already, please forgive my ignorance. – f1nan Dec 6 '16 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.