Geometry Simplify

65 views
Skip to first unread message

elpaso

unread,
Jan 9, 2012, 8:07:12 AM1/9/12
to Tilestache
Hi all,

I need a vector driver which would simplify geometries, is there
anything already implemented ?

I've started a simple clone of the Vector.Provider class which accepts
a new simplify parameter, most like the spacing one, OGR (through
GEOS) already supports douglas-peucker so it shouldn't be a problem.

Any hints, ideas, suggestions ?

Michal Migurski

unread,
Jan 9, 2012, 10:23:22 PM1/9/12
to tiles...@googlegroups.com
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.

----------------------------------------------------------------
michal migurski- mi...@stamen.com
415.558.1610

elpaso

unread,
Jan 10, 2012, 3:17:00 AM1/10/12
to Tilestache
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.


Reply all
Reply to author
Forward
0 new messages