[postgis-devel] Visvalingam’s simplification and twkb with zoom-levels
Nicklas Avén
nicklas.aven at jordogskog.no
Thu Jan 8 15:14:01 PST 2015
Hallo all
Happy New Year!
As happens sometimes I get an idea that I want to try.
Now it is about vector geometries with zoom-levels.
The goal is to let a client reuse the points from lower zoom-levels in
the higher zoom levels.
I have tried to describe the idea in the attached pdf. It is very
doable, but is it worth the effort?
Anyway, as a part of that I have written a function for simplification
with Visvalingam’s algorithm
https://hydra.hull.ac.uk/resources/hull:8338
It is also described here by Mike Bostock
http://bost.ocks.org/mike/simplify/
The function stores the effective area of each vertex-point in the
m-value. There is also a second parameter in the function so it is
possible to set a limit what minimum effective area that the resulting
geometry vertex points shall have. If the threshold is used it works lie
direct simplification. If not the effective area is just stored to all
original vertex-points and can be used later to very fast simplify.
This algorithm seems I think is more efficient for the purpose of
creating multiple zoom-levels at once as described in the pdf.
So is this ST_SetEffectiveArea something we want?
The speed seems to be about the same as ST_Simplify.
The result, if calibrating ST_Simplify and ST_SetEffectiveArea with a
threashold so they give the same number of points returns slightly
different geometries. I think none is more right or wrong then the
other, but different.
I have working code for ST_SetEffectiveArea for lines and polygons. It
is also easy to implement for 3D. The effective area will work the same
way since each triangle between 3 points always will be coplanar.
So, do we want ST_SetEffectiveArea(geom) and ST_SetEffectiveArea(geom,
trhld)?
Any thoughts about the idea with zoomlevels?
I wish I could come to the sprint ....
Best Regards
Nicklas Avén
-------------- next part --------------
A non-text attachment was scrubbed...
Name: twkbZL.pdf
Type: application/pdf
Size: 97805 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20150109/c0e42e98/attachment.pdf>
More information about the postgis-devel
mailing list