<div dir="ltr">Hi Matthias,<div><br></div><div>sounds like exactly what I need. Unfortunately, QFieldSync depends on qgis2compat which in turn wants to use the QtTest PyQt module which apparently I do not have. Ah, my default PyQt4 was compiled and installed without QtTest, will just need to reinstall. Perhaps of interest that not all systems come with QtTest by default.</div><div><br></div><div>I looked at <a href="https://github.com/opengisch/qfieldsync">https://github.com/opengisch/qfieldsync</a> a bit, perhaps I can extract the relevant parts.</div><div><br></div><div>Thanks, I would never have discovered this by myself,</div><div><br></div><div>-Andreas</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 31, 2017 at 1:25 PM, Matthias Kuhn <span dir="ltr"><<a href="mailto:matthias@opengis.ch" target="_blank">matthias@opengis.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
Hi Andreas,<br>
<br>
You can use the QFieldSync plugin which comes with a processing
algorithm that renders a styled map within a given extent to a
raster dataset.<br>
<br>
Matthias<br>
<br>
<div class="m_1703734962157508136moz-cite-prefix">On 5/31/17 6:29 PM, Andreas Plesch
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr"><span style="color:rgb(0,0,0);font-size:16px">Responding
to myself, I found this processing script in the script
repository:</span>
<div style="color:rgb(0,0,0);font-size:16px"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px"><a href="https://github.com/qgis/QGIS-Processing/blob/master/scripts/Create_rasters_from_canvas_for_each_vector_layer_feature_extent.py" target="_blank">https://github.com/qgis/QGIS-P<wbr>rocessing/blob/master/scripts/<wbr>Create_rasters_from_canvas_<wbr>for_each_vector_layer_feature_<wbr>extent.py</a><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px">It does almost what
I had in mind. Its presence indicates that indeed some Python
scripting is necessary.</div>
<div style="color:rgb(0,0,0);font-size:16px"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px">I may give it a
try. Unlike above, I would probably try to avoid using the
composer and just go for the straight maprenderer as in the
map rendering cookbook example: <a href="http://docs.qgis.org/2.18/en/docs/pyqgis_developer_cookbook/composer.html#simple-rendering" target="_blank">http://docs.qgis.org/<wbr>2.18/en/docs/pyqgis_developer_<wbr>cookbook/composer.html#simple-<wbr>rendering</a></div>
<div style="color:rgb(0,0,0);font-size:16px"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px">I wonder if it will
be necessary to clone the mapcanvas maprendercontext to
preserve current settings ?</div>
<div style="color:rgb(0,0,0);font-size:16px"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px">The main idea is to
use the rasterized, styled vector layer as a georeferenced
image outside of QGis.</div>
<div style="color:rgb(0,0,0);font-size:16px"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px">-Andreas</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, May 30, 2017 at 2:19 PM,
Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@netscape.net" target="_blank">andreasplesch@netscape.net</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I feel I am missing a basic function
somewhere to "burn" (in gdal terms) a vector layer as
styled by QGIS, for example with labels, to a raster layer
(of some resolution).
<div><br>
</div>
<div>The Rasterize (vector to raster) function is based on
gdal_rasterize and does not take into account styling as
it focuses on preserving the actual data.</div>
<div><br>
</div>
<div>The work around I am currently using is to use
Project-Save as Image while displaying only the styled
vector layer which will generate a correct world file
helper, then loading the generated image as raster layer
and assigning the correct projection. Finally, I clip
the raster with the original extent of the vector layer.</div>
<div><br>
</div>
<div>This works but is limited as the resolution is
constrained by the physical size of the map window and
requires the additional house keeping steps.</div>
<div><br>
</div>
<div>qgis2web or QTiles or OGR2Tiles as plugins do
something like this internally but I could not find a
plugin which just generates a regular raster layer (say
geotiff).</div>
<div><br>
</div>
<div>I also know I could probably produce a short Python
script (perhaps as processing script) to do this but
still think I am missing something ?</div>
<div><br>
</div>
<div>Any help or hint much welcome,</div>
<div><br>
</div>
<div>Andreas</div>
<div><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="m_1703734962157508136mimeAttachmentHeader"></fieldset>
<br>
<pre>______________________________<wbr>_________________
Qgis-user mailing list
<a class="m_1703734962157508136moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
List info: <a class="m_1703734962157508136moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="m_1703734962157508136moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>