[postgis-users] postgis topology strange behavior

Gonçalo Revez goncalorevez at gmail.com
Mon Feb 24 04:01:28 PST 2014


Hello,

I'm using the postgis topology with the following example below.

It inserts three contiguous polygons, but the third has a strange behavior.

It seems that the polygon doesn't snap totally to the other polygon (with
model tolerance of 0.1), where he should split the edges and create a node.

The problem raises two edges "overlapped". (I attach an image showing the
topology error).

In fact, using the jts viewer, the third polygon overlaps the first
polygon, but below the topology model tolerance.

How is it possible to solve this type of situation or what could be the
error in example?


Thanks
Gonçalo

--x--

--drop topology
select topology.DropTopology('test_topo');

--create topology
SELECT CreateTopology('test_topo', 20791,0.1);

--create topo geometries table
create table test_topo.area_topo(id serial primary key, bottom boolean);

--create topo geometry column
select topology.AddTopoGeometryColumn('test_topo','test_topo', 'area_topo',
'topo_geom', 'POLYGON');

SET search_path TO topology, public, test_topo;

--insert polygon 1
insert into test_topo.area_topo(id,topo_geom, bottom)
select
1,topology.toTopoGeom(ST_GeomFromEWKT('SRID=20791;POLYGON((-99221.0688378750346601
-99577.07580991843133233,-99192.60793616733280942
-99686.85357364814262837,-99288.83288956005708314
-99727.51200465914735105,-99380.99199985167069826
-99768.17043567015207373,-99433.84796016597829293
-99700.4063839851442026,-99435.20324119967699517
-99571.6546857836219715,-99349.8205360765568912
-99570.29940474992326926,-99221.0688378750346601
-99577.07580991843133233))'), 'test_topo',1,0), true;

--insert polygon 2
insert into test_topo.area_topo(id,topo_geom, bottom)
select
2,topology.toTopoGeom(ST_GeomFromEWKT('SRID=20791;POLYGON((-99105.19230949365010019
-99703.11694605252705514,-99192.60793616733280942
-99686.85357364814262837,-99221.0688378750346601
-99577.07580991843133233,-99169.56815859441121574
-99535.06209787368425168,-99095.02770174089528155
-99582.49693405319703743,-99017.09904230313259177
-99629.25412971586047206,-99034.04005522439547349
-99715.99211587267927825,-99105.19230949365010019
-99703.11694605252705514))'), 'test_topo',1,0), true;

--insert polygon 3
insert into test_topo.area_topo(id,topo_geom, bottom)
select
3,topology.toTopoGeom(ST_GeomFromEWKT('SRID=20791;POLYGON((-99095.34929557323630434
-99874.08768260208307765,-99180.89702985195617657
-99864.18215547507861629,-99285.8180822192953201
-99726.23814240249339491,-99192.60793616733280942
-99686.85357364814262837,-99105.19230949365010019
-99703.11694605252705514,-99071.31028365115344059
-99810.86178823169029783,-99095.34929557323630434
-99874.08768260208307765))'), 'test_topo',1,0), true;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140224/f1e963a1/attachment.html>


More information about the postgis-users mailing list