[postgis-users] ST_CreateTopoGeo
Sandro Santilli
strk at kbt.io
Tue Mar 3 09:22:34 PST 2020
On Tue, Mar 03, 2020 at 02:30:11PM +0000, paul.malm at lfv.se wrote:
> Hi,
> I'm not sure of what you mean, Strk.
> I create a topology (topo1) with all geometries from a polygon layer.
> I can see the island and the Egypt polygon in the edge_data, they are not intersecting.
>
> Then I create a new topology (topo2) with:
> select topology.ST_CreateTopoGeo('topo2', the_geom) from (
> select ST_Collect(st_simplifyPreserveTopology(geom, 5000)) as the_geom
> from topo1.edge_data) as foo;
Is Egypt still there when you look at topology faces ?
> Here in the topo2.edge.data I can see that the island and the polygon of Egypt is intersecting due to the simplifying.
> And when I create a new polygon layer from this edge_data the Egypt polygon is left out.
>
> This is done with:
> with simple_face as ( select topology.st_getFaceGeometry('topo2', face_id) as the_geom
> from topo2.face
> where face_id > 0 ) update newlayer d set geom = sf.the_geom
> from simple_face sf
> where st_intersects(d.geom, sf.the_geom)
> st_area(st_intersection(sf.the_geom, d.geom))/st_area(sf.the_geom) > 0.5";
I suspect you're just filtering out too many faces, due
to small intersection area..
--strk;
More information about the postgis-users
mailing list