[postgis-users] Simplify a perfect (hierarchical) partition of polygons (ST_SimplifyPreserveTopology and friends)

Sandro Santilli strk at keybit.net
Wed Mar 14 00:01:05 PDT 2012

On Wed, Mar 14, 2012 at 12:19:41AM +0000, Martin Tomko wrote:

> - is the hierarchicalTopoGeom somehow explicitly created, or is it just a
> part of topoGeom internal implementation? Can I profit of this hierarhcial
> topological concept directly?

Explicitly created. When you create a layer (AddTopoGeometryColumn) you
specify the id of the "child layer". At that point the element_id you'll
use when constructing the TopoGeometry won't refer to primitive (node,edge,
face) identifiers but rather to TopoGeometry identifiers.

> - If I build a TopoGEom, and run ST_SimplifyPReserveTopology on it, will
> the nodes be respected and the topology preserved in the output (the
> result should be a topogeom...)?

No, this is not yet "magically done". Returning a TopoGeom would be cheating
as a TopoGeom is really a 1:N reference to other objects into the database,
so you have no literal and thus it takes creating or modifying a whole schema
in order to do that (more or less).

I think that returning a simple geometry but using the topological structure
would be a good interface. It'd be then up to you to decide what to do with
the returned simple. It's not implemented yet.

> I think that the best way for this hierarchical scenarios is to start from
> the finest geographies and aggregate upwards on the generalised ones. I
> will have to somehow control for the intermediate nodes that are not valid
> for higher order geometries (joins of suburbs on the state boundary,
> etcŠ), but that I could solve somehow.

Yes, it probably don't make sense to simplify single TopoGeoms in turn if
you know you're going to simplify the whole topology. In that case you would
just make a copy of the topology and then simplify all edges on the copy.
Existing TopoGeometry objects (appropriately re-bound to the new topology)
would magically convert to a simplified version of simple geometries. Both
simple and hierarchical ones.


  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com

More information about the postgis-users mailing list