Inverted polygon renderer and shapeburst fill in qgis server tiles

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Inverted polygon renderer and shapeburst fill in qgis server tiles

Régis Haubourg
Hi,
working on qgisserver install here with tiled client (Lizmap), we encountered that empty tiles are rendered with borders inheriting from shapeburstfill.
See picture [0]

That is fine in desktop QGIS mapcanvas unless we put an oversized "shade to distance" value.
See [1]

Any idea if there could be a workaround to avoid that with inverted polygon renderer tiles? I guess Nyall knows that  ;-)

Cheers
Régis

[0] https://drive.google.com/file/d/0BzatQbprJ-hjM3RnTmFMaEZiWDQ/view?usp=sharing
[1] https://drive.google.com/file/d/0BzatQbprJ-hjbXdESU1xUFJhdVU/view?usp=sharing
Reply | Threaded
Open this post in threaded view
|

Re: Inverted polygon renderer and shapeburst fill in qgis server tiles

Régis Haubourg
ticket filed here : http://hub.qgis.org/issues/13406

Cheers
Régis
Reply | Threaded
Open this post in threaded view
|

Re: Inverted polygon renderer and shapeburst fill in qgis server tiles

Nyall Dawson
In reply to this post by Régis Haubourg
On 17 September 2015 at 23:37, Régis Haubourg
<[hidden email]> wrote:

> Hi,
> working on qgisserver install here with tiled client (Lizmap), we
> encountered that empty tiles are rendered with borders inheriting from
> shapeburstfill.
> See picture [0]
>
> That is fine in desktop QGIS mapcanvas unless we put an oversized "shade to
> distance" value.
> See [1]
>
> Any idea if there could be a workaround to avoid that with inverted polygon
> renderer tiles? I guess Nyall knows that  ;-)

It's not simple ;) but I agree that it's an annoying side effect of
the shapeburst. You'll also notice that with a large enough distance
you'll also see the effects of polygons being clipped just outside of
the canvas

The answer is hiding somewhere in
QgsShapeburstFillSymbolLayerV2::distanceTransform1d:
https://github.com/qgis/QGIS/blob/master/src/core/symbology-ng/qgsfillsymbollayerv2.cpp#L1262
Basically at the moment that algorithm assumes that pixels at the
beginning and end of a row should have an initial distance of 0, when
for our uses they should have an initial distance of infinite.
Unfortunately the highly-optimised maths in that function is a bit
beyond my grasp, so if a shotgun trial-and-error approach fails, I'll
need to wait until someone with more advanced mathematical
understanding comes along to fix this!

Nyall





>
> Cheers
> Régis
>
> [0]
> https://drive.google.com/file/d/0BzatQbprJ-hjM3RnTmFMaEZiWDQ/view?usp=sharing
> [1]
> https://drive.google.com/file/d/0BzatQbprJ-hjbXdESU1xUFJhdVU/view?usp=sharing
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Inverted-polygon-renderer-and-shapeburst-fill-in-qgis-server-tiles-tp5224645.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Inverted polygon renderer and shapeburst fill in qgis server tiles

Régis Haubourg
Hi Nyall,
thanks very much for the pointer, we know now where to look for a solution.
Another hypothesis, couldn't that be the inverted polygon renderer that is sending a polygon clipped by map extent + a margin ? If this is the case, we could simply put a greater margin value. Maybe Hugo at oslandia knows that.

Cheers
Régis
Reply | Threaded
Open this post in threaded view
|

Re: Inverted polygon renderer and shapeburst fill in qgis server tiles

Hugo Mercier
Hi Régis,

On 30/09/2015 09:03, Régis Haubourg wrote:
> Hi Nyall,
> thanks very much for the pointer, we know now where to look for a solution.
> Another hypothesis, couldn't that be the inverted polygon renderer that is
> sending a polygon clipped by map extent + a margin ? If this is the case, we
> could simply put a greater margin value. Maybe Hugo at oslandia knows that.
>

I am not sure to understand the problem, i.e. what happens with qgis
server that does not with the regular map canvas ?

But to answer your question, there is already a margin taken around the
map extent :
https://github.com/qgis/QGIS/blob/master/src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp#L95

This is completely arbitrary (x5), but this is just to cheat the concept
of an "inverted" geometry that does not really exist in QGIS. So we can
bump up the factor to say x10 ... and it will just translate the problem
a bit further ...

The solution proposed by Nyall (adding the possibility to have an
infinite distance if I understood correctly) is better I think.

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Inverted polygon renderer and shapeburst fill in qgis server tiles

Régis Haubourg
Hugo Mercier wrote
The solution proposed by Nyall (adding the possibility to have an
infinite distance if I understood correctly) is better I think.
Hi Hugo,
you're right. If someone has sufficient math skills to avoid a dirty workaround, I'd be pleased to have him work on it ;-).
Cheers
Régis