[Qgis-developer] Is it possible to re-use print composer code to build a web service ?

Alessandro Pasotti apasotti at gmail.com
Mon Dec 20 10:03:57 EST 2010


2010/12/20 Martin Dobias <wonder.sk at gmail.com>

> On Mon, Dec 20, 2010 at 3:19 PM, Alessandro Pasotti <apasotti at gmail.com>
> wrote:
> > 2010/12/20 Martin Dobias <wonder.sk at gmail.com>
> >>
> 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
>


I've also tried that way...

I've got no more than segfaults:

http://dpaste.com/288618/

Can you please take a quick look to my experiment ?

http://dpaste.com/288616/


-- 
Alessandro Pasotti
w3:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20101220/2a27c4bf/attachment.html


More information about the Qgis-developer mailing list