[Qgis-developer] Map production using Python

leyan ouyang ouyang.leyan at hotmail.com
Tue Sep 18 18:12:45 PDT 2012


Regarding the second question, if I remember correctly, you can use setNewExtent on your ComposerMap object (taking a QgsRectangle as argument).

> From: veigacamargo at gmail.com
> To: qgis-developer at lists.osgeo.org
> Date: Tue, 18 Sep 2012 16:05:00 -0700
> Subject: [Qgis-developer] Map production using Python
> 
> Hi guys,
> 	I have a few questions that I'd like to ask here.
> 
> 	1st - I'm trying to write a code that I can run from a python shell
> outside  QGIS, but I'm not finding the path where I should be importing qgis
> from.
> 
> 	2nd - I have to print a series of hundreds of maps and I was
> planning into using the a map composer, but in the map I get, my layer
> occupy a small part of the whole composer. I have this problem when I'm
> working manually too, but then I can correct it.  How can I set it right so
> my layer take the whole canvas?
> 
> I'm using the following software:
> 
> - Windows 7 64bits
> - QGIS 1.8
> Python 2.73
> 
> Thanks,
> 
> Pedro
> 
> -----Original Message-----
> From: qgis-developer-bounces at lists.osgeo.org
> [mailto:qgis-developer-bounces at lists.osgeo.org] On Behalf Of
> qgis-developer-request at lists.osgeo.org
> Sent: Tuesday, September 18, 2012 12:00 PM
> To: qgis-developer at lists.osgeo.org
> Subject: Qgis-developer Digest, Vol 83, Issue 49
> 
> Send Qgis-developer mailing list submissions to
> 	qgis-developer at lists.osgeo.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.osgeo.org/mailman/listinfo/qgis-developer
> or, via email, send a message with subject or body 'help' to
> 	qgis-developer-request at lists.osgeo.org
> 
> You can reach the person managing the list at
> 	qgis-developer-owner at lists.osgeo.org
> 
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of Qgis-developer digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: [Qgis-user] Sextante - error saving a model with Select
>       by location tool (Victor Olaya)
>    2. Re: Demo WMS/WFS QGIS server (Tim Sutton)
>    3. Re: Add ST_MakeValid functionality to QgsGeometry?
>       (Giovanni Manghi)
>    4. Re: [Qgis-user] Sextante - error saving a model	with Select
>       by location tool (Pedro Ven?ncio)
>    5. Re: Demo WMS/WFS QGIS server (Paolo Cavallini)
>    6. Re: Demo WMS/WFS QGIS server (Tim Sutton)
>    7. QgsFillSymbolLayerV2 descendants missing from sip (Massimo)
>    8. PyCookBook wrong link (Paolo Cavallini)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 18 Sep 2012 13:23:26 +0200
> From: Victor Olaya <volayaf at gmail.com>
> To: Pedro Ven?ncio <pedrongvenancio at yahoo.com>
> Cc: "qgis-user at lists.osgeo.org" <qgis-user at lists.osgeo.org>,	Qgis
> 	Developer List <qgis-developer at lists.osgeo.org>
> Subject: Re: [Qgis-developer] [Qgis-user] Sextante - error saving a
> 	model with Select by location tool
> Message-ID:
> 	<CAJsc-7ytbdCPXW9fniSMsUfB1CEUA0e65JgKjjX6TqhdqyqR3g at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Yes please, fill a ticket.
> 
> Many thanks!
> 
> 2012/9/18 Pedro Ven?ncio <pedrongvenancio at yahoo.com>:
> > Hi Victor,
> >
> > Ok, thanks!
> >
> > I also found a problem with the Select tool from MMQGISX. When selecting a
> physical layer that is loaded in QGIS, even in modeler, it works well.
> However, when using Select with intermediate layers within modeler, it says
> that the project has no active layer to select from (image attached).
> >
> > I think I'll fill a ticket for both problems, what do you think?
> >
> > Thank you very much!
> >
> > Best regars,
> > Pedro
> >
> >
> > PS: Good luck with your new job! :)
> >
> >
> >
> >
> > ----- Original Message -----
> > From: Victor Olaya
> >
> > Hi Pedro
> >
> > The problem is that the select algorithm does not generate a new 
> > layer, but just makes a selection on a existing one. It seems that 
> > this case hasn't been correctly considered...
> >
> > I will have a look at it and see if I can fix it
> >
> > Regards
> >
> >
> >
> > 2012/9/18 Pedro Ven?ncio <pedrongvenancio at yahoo.com>:
> >> Hi,
> >>
> >>
> >> I can not save a model in which is used the tool 'Select by location'
> from fTools.
> >>
> >> When saving, it shows the error:
> >>
> >>
> >> An error has occured while executing Python code:
> >>
> >> Traceback (most recent call last):
> >>   File
> "/home/pedro/.qgis//python/plugins/sextante/modeler/ModelerDialog.py", line
> 219, in saveModel
> >>     text = self.alg.serialize()
> >>   File
> "/home/pedro/.qgis//python/plugins/sextante/modeler/ModelerAlgorithm.py",
> line 305, in serialize
> >>     s+=unicode(self.algOutputs[i][out.name]) + "\n"
> >> KeyError: 'OUTPUT'
> >>
> >> Python version:
> >> 2.7.3 (default, Aug  1 2012, 05:27:35) [GCC 4.6.3]
> >>
> >> QGIS version:
> >> 1.9.0-Master Master, exported
> >>
> >> Python path: ['/home/pedro/.qgis//python/plugins/ogrprocessing', 
> >> '/home/pedro/.qgis//python/plugins/sextante', 
> >> '/usr/share/qgis/python', '/home/pedro/.qgis//python', 
> >> '/home/pedro/.qgis//python/plugins', 
> >> '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', 
> >> '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', 
> >> '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', 
> >> '/usr/local/lib/python2.7/dist-packages', 
> >> '/usr/lib/python2.7/dist-packages', 
> >> '/usr/lib/python2.7/dist-packages/PIL', 
> >> '/usr/lib/python2.7/dist-packages/gst-0.10', 
> >> '/usr/lib/python2.7/dist-packages/gtk-2.0', 
> >> '/usr/lib/pymodules/python2.7', 
> >> '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', 
> >> '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', 
> >> '/home/pedro/.qgis/python/plugins/mmqgis/forms', 
> >> '/home/pedro/.qgis/python/plugins/qgis2kml', 
> >> '/home/pedro/.qgis/python/plugins/qgis2kml', 
> >> '/usr/share/qgis/python/plugins/fTools/tools']
> >>
> >>
> >>
> >> And then, when I try to remove the module 'Select by location' from the
> model, it shows the error:
> >>
> >> An error has occured while executing Python code:
> >>
> >> Traceback (most recent call last):
> >>   File
> "/home/pedro/.qgis//python/plugins/sextante/modeler/ModelerGraphicItem.py",
> line 89, in removeElement
> >>     if not self.model.removeAlgorithm(self.elementIndex):
> >>   File
> "/home/pedro/.qgis//python/plugins/sextante/modeler/ModelerAlgorithm.py",
> line 164, in removeAlgorithm
> >>     val = self.algOutputs[index][out.name]
> >> KeyError: 'OUTPUT'
> >>
> >> Python version:
> >> 2.7.3 (default, Aug  1 2012, 05:27:35) [GCC 4.6.3]
> >>
> >> Which will be the problem?
> >>
> >> Thank you very much!
> >>
> >> Best regards,
> >> Pedro Ven?ncio
> >>
> >> _______________________________________________
> >> Qgis-user mailing list
> >> Qgis-user at lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/qgis-user
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Tue, 18 Sep 2012 13:52:57 +0200
> From: Tim Sutton <lists at linfiniti.com>
> To: Paolo Cavallini <cavallini at faunalia.it>
> Cc: qgis-developer <qgis-developer at lists.osgeo.org>
> Subject: Re: [Qgis-developer] Demo WMS/WFS QGIS server
> Message-ID:
> 	<CALCNqkZ6V8_bjyu5O1d5+bCc0Dt+VbaLoNhS-_Yz_VTqy4T3YA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi
> 
> On Tue, Sep 18, 2012 at 12:37 PM, Paolo Cavallini <cavallini at faunalia.it>
> wrote:
> > Hi all.
> > Would it be reasonable having a sample WMS and WFS QGIS instance, 
> > automatically installed at every commit?
> > I think it would be useful to quickly spot issues with various clients
> etc.
> 
> I could do this with jenkins....maybe remind me at the HF if I dont get to
> it before then.
> 
> Regards
> 
> Tim
> 
> > All the best.
> >
> > --
> > Paolo Cavallini - Faunalia
> > www.faunalia.eu
> > Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: 
> > http://www.faunalia.it/calendario
> >
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> 
> 
> --
> Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
> ==============================================
> Please do not email me off-list with technical support questions. Using the
> lists will gain more exposure for your issues and the knowledge surrounding
> your issue will be shared with all.
> 
> Visit http://linfiniti.com to find out about:
>  * QGIS programming and support services
>  * Mapserver and PostGIS based hosting plans
>  * FOSS Consulting Services
> Skype: timlinux
> Irc: timlinux on #qgis at freenode.net
> ==============================================
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Tue, 18 Sep 2012 13:06:15 +0100
> From: Giovanni Manghi <giovanni.manghi at faunalia.pt>
> To: qgis-developer at lists.osgeo.org
> Subject: Re: [Qgis-developer] Add ST_MakeValid functionality to
> 	QgsGeometry?
> Message-ID: <1347969975.2633.115.camel at sibirica>
> Content-Type: text/plain; charset="UTF-8"
> 
> Hi Larry,
> 
> > 
> > What's the likelihood that the ST_MakeValid function could be ported 
> > to QGIS?... ending up with something like:
> 
> 
> glad you raised this question. The common users really misses a tool to
> allow easily fix geometries in QGIS, and the feedback is that when is needed
> they usually use other GIS software (for example many of the tools in the
> "vector" menu do not return the expected results if the geometries are not
> valid).
> 
> Any improvement in this field would be very welcome.
> 
> cheers
> 
> -- Giovanni --
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Tue, 18 Sep 2012 06:22:23 -0700 (PDT)
> From: Pedro Ven?ncio <pedrongvenancio at yahoo.com>
> To: Victor Olaya <volayaf at gmail.com>
> Cc: "qgis-user at lists.osgeo.org" <qgis-user at lists.osgeo.org>,	Qgis
> 	Developer List <qgis-developer at lists.osgeo.org>
> Subject: Re: [Qgis-developer] [Qgis-user] Sextante - error saving a
> 	model	with Select by location tool
> Message-ID:
> 	<1347974543.91931.YahooMailNeo at web122303.mail.ne1.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-1
> 
> Ok Victor, just for record on this thread:
> 
> http://hub.qgis.org/issues/6362 
> 
> http://hub.qgis.org/issues/6363 
> 
> 
> Thanks!
> 
> Best regards,
> Pedro
> 
> 
> 
> 
> 
> ----- Original Message -----
> From: Victor Olaya
> 
> Yes please, fill a ticket.
> 
> Many thanks!
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Tue, 18 Sep 2012 16:54:35 +0200
> From: Paolo Cavallini <cavallini at faunalia.it>
> To: Tim Sutton <lists at linfiniti.com>
> Cc: qgis-developer <qgis-developer at lists.osgeo.org>
> Subject: Re: [Qgis-developer] Demo WMS/WFS QGIS server
> Message-ID: <50588B2B.80209 at faunalia.it>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Il 18/09/2012 13:52, Tim Sutton ha scritto:
> >
> > I could do this with jenkins....maybe remind me at the HF if I dont 
> > get to it before then.
> >
> I took the liberty of adding it here, hope you do not mind:
> http://hub.qgis.org/wiki/quantum-gis/8_QGIS_Developer_Meeting_in_Essen_2012#
> Participation
> thanks
> 
> --
> Paolo Cavallini - Faunalia
> www.faunalia.eu
> Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS:
> http://www.faunalia.it/calendario
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Tue, 18 Sep 2012 16:59:57 +0200
> From: Tim Sutton <lists at linfiniti.com>
> To: Paolo Cavallini <cavallini at faunalia.it>
> Cc: qgis-developer <qgis-developer at lists.osgeo.org>
> Subject: Re: [Qgis-developer] Demo WMS/WFS QGIS server
> Message-ID:
> 	<CALCNqkaWwqbOTOGTTqwKhhTA9jrB28jPVe_qUzdbrDZ9u24VFg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi
> 
> On Tue, Sep 18, 2012 at 4:54 PM, Paolo Cavallini <cavallini at faunalia.it>
> wrote:
> > Il 18/09/2012 13:52, Tim Sutton ha scritto:
> >>
> >> I could do this with jenkins....maybe remind me at the HF if I dont
> >> get to it before then.
> >>
> > I took the liberty of adding it here, hope you do not mind:
> >
> http://hub.qgis.org/wiki/quantum-gis/8_QGIS_Developer_Meeting_in_Essen_2012#
> Participation
> > thanks
> >
> 
> Perfect!
> 
> T
> 
> > --
> > Paolo Cavallini - Faunalia
> > www.faunalia.eu
> > Full contact details at www.faunalia.eu/pc
> > Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario
> >
> 
> 
> 
> -- 
> Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
> ==============================================
> Please do not email me off-list with technical
> support questions. Using the lists will gain
> more exposure for your issues and the knowledge
> surrounding your issue will be shared with all.
> 
> Visit http://linfiniti.com to find out about:
>  * QGIS programming and support services
>  * Mapserver and PostGIS based hosting plans
>  * FOSS Consulting Services
> Skype: timlinux
> Irc: timlinux on #qgis at freenode.net
> ==============================================
> 
> 
> ------------------------------
> 
> Message: 7
> Date: Tue, 18 Sep 2012 09:52:54 -0700 (PDT)
> From: Massimo <massimo.endrighi at geopartner.it>
> To: qgis-developer at lists.osgeo.org
> Subject: [Qgis-developer] QgsFillSymbolLayerV2 descendants missing
> 	from sip
> Message-ID: <1347987174862-5002739.post at n6.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Dear QGis developper Team,
> 
> QgsFillSymbolLayerV2 descendants, but also QgsLineSymbolLayerV2 and
> QgsMarkerSymbolLayerV2 descendants are missing from sip. 
> Working with styles to a deep level it is impossible without such
> exportation.
> Is this by design or can I add all the missing stuff in sip files? 
> 
> Regards
> Massimo
> 
> 
> 
> 
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/QgsFillSymbolLayerV2-descendants-missing
> -from-sip-tp5002739.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> 
> 
> ------------------------------
> 
> Message: 8
> Date: Tue, 18 Sep 2012 19:17:26 +0200
> From: Paolo Cavallini <cavallini at faunalia.it>
> To: qgis-developer <qgis-developer at lists.osgeo.org>
> Subject: [Qgis-developer] PyCookBook wrong link
> Message-ID: <5058ACA6.3090303 at faunalia.it>
> Content-Type: text/plain; charset=ISO-8859-15
> 
> http://www.qgis.org/pyqgis-cookbook/intro.html
> the link complete QGIS API
> is pointing to
> http://doc.qgis.org/
> instead of
> http://qgis.org/api/
> 
> All the best.
> 
> -- 
> Paolo Cavallini - Faunalia
> www.faunalia.eu
> Full contact details at www.faunalia.eu/pc
> Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> 
> End of Qgis-developer Digest, Vol 83, Issue 49
> **********************************************
> 
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120919/dfa379fe/attachment-0001.html>


More information about the Qgis-developer mailing list