On Mon, Dec 20, 2010 at 3:19 PM, Alessandro Pasotti <[email protected]> wrote: > 2010/12/20 Martin Dobias <[email protected]> >> http://www.qgis.org/pyqgis-cookbook/composer.html#output-using-map-composer > > Thanks Martin, > I have already found your example, but it is for a plugin, isn't it ? > I remember I tried to make it work from outside qgis (standalone) without > success.
Yes that code should work from python console in qgis or within a plugin. You can also make it working from outside of qgis application as a command line tool, you will just have to do some bootstrapping: initialize qgis libraries (QgsApplication: setPrefixPath, initQgis), load some layers, construct and set up a map renderer (QgsMapRenderer). The example code omits that for simplicity and uses map renderer from canvas. > What I would like to achieve is a CGI-style application which takes WMS-like > parameters (like qgis-mapserver does) and a printcomposer template to > generate a (vectorial) PDF. This is indeed possible - one just has to initialize all the machinery as briefly described above. Regards Martin _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
