Linked Questions

21
votes
3answers
16k views

Problem with import qgis.core when writing a stand-alone PyQGIS script

I am trying to write a stand alone python script in windows 7 that uses qgis.core and various other qgis libraries. I have found an old question on this subject here: Writing standalone Python ...
7
votes
1answer
3k views

Saving Map Canvas as PNG with transparent background programmatically with QGIS?

I wrote a script to create a big number of heat maps for a given scenario. I would like to save the result of every heat map as an PNG image. I have figured it out doing it with simple Map Rendering ...
9
votes
2answers
2k views

Export a configured Atlas with a Python script / command line?

I just want to export a configured Atlas (composer with Atlas option and cover layer enabled) I tried this : composerView = qgis.utils.iface.activeComposers()[0] composition = composerView....
7
votes
1answer
2k views

Batch export from multiple QGS projects to image or PDF

I'm looking out for a way to batch export to PDF or image many composers spread in many QGS projects, the same way the plugin Map Printer does, but on a large number of projects at the same time. ...
4
votes
1answer
3k views

Programmatically exporting composition as image from QGIS?

QGIS Print Composer has tool "Save As Image" and I found appropriate function in QGIS source code exportCompositionAsImage. Is it possible to get access to existing Print Composer from Python console ...
11
votes
1answer
1k views

QGIS export composer as pdf in python

I have a QGIS project which contains a composer. Of course if I go into the GUI I can export it as a pdf etc. For my make script though I want to have this done via a python script. From reading ...
10
votes
1answer
1k views

How to fill composer map with canvas data and export composition as png using Python script in QGIS

I'd like to create a Python script in QGIS that will take some data (shp + tif, in my example), use tamplate Map Composer (from a file) and export created composition to a png image. With almost no ...
3
votes
1answer
437 views

How to export Atlas as images from a headless server?

I have a QGIS project that has an Atlas print composer that I can use to generate multiple images (JPG) of each of my departments. Now I would want to generate all those images but directly from a ...
0
votes
1answer
760 views

PyQGIS change layer visibility

I'm trying to automate the creation of images using a combination of QGIS map documents and templates as discussed here using a standalone script. When complete, the script will regenerate a map using ...
3
votes
2answers
436 views

How can I read the settings for the QgsPaperItem from XML?

I saved a template qpt for the map composer and now I want to read all the settings. I am able to insert the items with composition.addItemsfromXML... But this doesn't load the settings for the ...
1
vote
1answer
675 views

Enable layer plugins when using external standalone QGIS python scripts

I created a QGIS standalone script (custom Application) that enables me to automatically export Atlas as images. The problem is that in my QGIS project, I'm using a Mask plugin and the generated ...
3
votes
1answer
545 views

Printing map in Print Composer to specified name (not Print Composer 1, 2, etc)?

I am trying to print a pdf map, while using a .qpt template. I can create a pdf output but I how do I name the created print composer? Each time I run the tool it creates a new 'Composer 1' then '...
2
votes
0answers
642 views

Save map canvas as image with Python in QGIS [duplicate]

I'm trying to save the map canvas as an image in Python in QGIS. I've looked in a few places but haven't been able to get something to work. I need a function where I can specify the extent of the map ...
1
vote
0answers
61 views

Composition of features into attributes field using QGIS

For every feature of my map, I have to: I localize the feature with its coordinate X-Y I zoom into the canvas in order to center the feature and to obtain the scale wanted (depending of every ...