Bug report #8154

Problems with Atlas and Map dimensions on composer using Python

Added by James Stott over 11 years ago. Updated about 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:16981

Description

Hi all,

Is anyone else having problems with using atlas with python?

I am writing some python code that uses the Atlas functionality in master to create a PDF / jpg for each of my 5000 records.

I can produce a jpg/pdf for each feature, however the composerMap object does not stay the same size.

I found this bug report which describes the issue. This report is listed as fixed:

#6956

I have also been made aware of this post about the issue too:

http://www.mail-archive.com/[email protected]/msg15587.html

I have set the following two lines in my code:

myAtlas.setFixedScale( False )
myAtlas.setMargin(0.1)

If I set this up from within QGIS, it works perfectly. It is only through Python I have problems.

Here are the example exported jpgs:

Generated inside QGIS GUI - from_qgis.zip

Generated from python - from_python.zip

I have also included a stripped down version of my code, along with a sample shapefile (this isn’t the data I am planning to use it with, but it doesn’t work with either the sample or the real data - the real data is in PostGIS).

Using master, updated today from OsGeo4W.

from_qgis.zip (336 KB) James Stott, 2013-06-24 11:31 PM

from_python.zip (209 KB) James Stott, 2013-06-24 11:31 PM

code_and_shapefile.zip (6.03 KB) James Stott, 2013-06-24 11:31 PM

History

#1 Updated by James Stott over 11 years ago

I have resorted to using the getNewExtent() method in the atlasdialog.py file from the original atlas plugin. This does what I want.

James

#2 Updated by Paolo Cavallini over 11 years ago

  • Category set to 33

#3 Updated by Giovanni Manghi over 10 years ago

  • Priority changed from High to Normal
  • Target version set to Version 2.2
  • Status changed from Open to Feedback
  • Category changed from 33 to Map Composer/Printing

There is no crash or data corruption, so I'm lowering the priority.

It is still true in the latest master?

#4 Updated by Jürgen Fischer over 10 years ago

  • Target version changed from Version 2.2 to Future Release - Lower Priority

#5 Updated by Nyall Dawson about 10 years ago

  • Status changed from Feedback to Closed
  • Resolution set to invalid

Closing due to lack of feedback

Also available in: Atom PDF