On Jan 10, 4:23 am, Michal Migurski <
m...@stamen.com> wrote:
> Hi elpaso,
>
> I often use Postgis in this case, which has built-in simplification functionality. Is that an option available to you? Alternatively, I'd be interested in adding simplification to the existing Vector provider.
>
> -mike.
Hi Michal,
using the postgis ST_... functions was the first thing I considered,
but I see two problems in this approach:
1. this would limit the functionality to the postgis driver while the
OGR vector supports many other, this is why I've chosen to use OGR
from python, after geometries have been fetched from the datasource
2. the function would probably best fit into the "query" parameter,
but in this case it would be difficult to make the tolerance change
with the scale (unless you specify a different layer for each scale,
which is non very practical)
I'm currently using a clone of the Vector provider, which supports
simplify parameter as a pixel unit, this means that we can say :
"simplify all that is below 1 px map unit", this is scale-dependant
(which is what I wanted).
If you like, I can branch and make a pull request, but there is still
a problem to solve: POLYGONS (and MULTIPOLYGON and GEOMETRYCOLLECTION
when there's a polygon inside), when tiling is activated the polygons
get sometimes simplified at the tile boundary, which is horrible, this
only happens when tolerance is set to a very high level though.