Opened 6 years ago

Closed 6 years ago

#2176 closed defect (fixed)

ST_ChangeEdgeGeom: exception on SymDifference

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.0.3
Component: topology Version: 2.0.x
Keywords: history Cc: paolo.crosato@…

Description

As reported here: http://lists.osgeo.org/pipermail/postgis-users/2013-January/036276.html

Robusness issues in GEOS result in exceptions thrown at ST_ChangeEdgeGeom time, where verifying that the incurred change would not change the data topology.

There could be improvements in that computation. For example we could skip the check completely if no nodes other than the endpoints of the line would fall within the extent of either old or new edge...

Attachments (2)

ticket2176_geoms.sql (2.7 KB) - added by ppll 6 years ago.
simplifyutm, geometries
ticket2176_geoms_hex.sql (1.4 KB) - added by ppll 6 years ago.
As HEXWKB

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by strk

See http://trac.osgeo.org/geos/ticket/614 for the GEOS side of this

comment:2 Changed 6 years ago by strk

Cc: paolo.crosato@… added

What's needed for this case is simplified data, starting from the geometry of the initial edge and of the simplified edge. Hopefully Paolo can provide that.

comment:3 Changed 6 years ago by strk

Rewriting the edge motion range computation may also help here. What we want to guarantee is that all points within the edge bounding box are still on their previous edge side (left or right)

Changed 6 years ago by ppll

Attachment: ticket2176_geoms.sql added

simplifyutm, geometries

comment:4 in reply to:  2 Changed 6 years ago by ppll

Replying to strk:

What's needed for this case is simplified data, starting from the geometry of the initial edge and of the simplified edge. Hopefully Paolo can provide that.

This is the call, topo name and edge id are just copy paste SELECT topology.ST_ChangeEdgeGeom('eu_geom_35_topo', 81018, SimplifyUTM(geom, 35)) FROM eu_geom_35_topo.edge WHERE edge_id = 81018;

In the attached file there is the original geometry, SimplifyUTM function definition and the geometry after SimplifyUTM call, all geometries are EWKB format.

Simplifyutm calls utmzone, it's the same function found in the postgis book, anyway here is the code from my instance: CREATE OR REPLACE FUNCTION public.utmzone(geometry)

RETURNS integer AS

$BODY$

DECLARE

geomgeog geometry; zone int; pref int;

BEGIN

geomgeog:= ST_Transform($1,4326); IF (ST_Y(geomgeog))>0 THEN

pref:=32600;

ELSE

pref:=32700;

END IF; zone:=floor((ST_X(geomgeog)+180)/6)+1; RETURN zone+pref;

END; $BODY$

LANGUAGE plpgsql IMMUTABLE COST 100;

Tell me if you need other data or details. Apologies if I made any mistake with the bug report system, first time I use it.

Paolo

comment:5 Changed 6 years ago by strk

Can you provide HEXWKB please ? It's what you get by default if you SELECT the_geom FROM table from a text cursor. I don't need the utmzone function, just the original and simplified geometries.

The idea is to produce a testcase that would trigger the bug in a script like this:

 SELECT CreateTopology('bug2176');
 SELECT TopoGeo_addLinestring('bug2176', '<first_geometry>');
 SELECT ST_ChangeEdgeGeom('bug2176', 1, '<second_geometry>');

With the smallest possible '<first_geometry>' and '<second_geometry>'

comment:6 Changed 6 years ago by ppll

Ok I'll ad an attachment with the hex output rightaway.

Paolo

Changed 6 years ago by ppll

Attachment: ticket2176_geoms_hex.sql added

As HEXWKB

comment:7 Changed 6 years ago by strk

Keywords: history added
Resolution: fixed
Status: newclosed

Great. Put under the testsuite and fixed postgis to be more robust in motion checking. r10983 in 2.0 branch and r10984 in trunk.

Note: See TracTickets for help on using tickets.