[postgis-devel] [PostGIS] #2025: side location conflict at topogeo_AddLineString() of separate edges
PostGIS
trac at osgeo.org
Tue Oct 2 01:59:44 PDT 2012
#2025: side location conflict at topogeo_AddLineString() of separate edges
----------------------+-----------------------------------------------------
Reporter: wimned | Owner: strk
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.1.0
Component: topology | Version: trunk
Keywords: |
----------------------+-----------------------------------------------------
Version I use:
POSTGIS="2.1.0SVN r10195" GEOS="3.3.4-CAPI-1.7.3" PROJ="Rel. 4.7.1, 23
September 2009" LIBXML="2.7.8" TOPOLOGY
Currently I build up topologies in separate districts, each in their own
schema. When I enter the resulting edges into a main topology I get this
error.
The message:
{{{
ERROR: GEOSContains: TopologyException: side location conflict at 2 4
CONTEXT: SQL statement "UPDATE wimpy.edge_data SET left_face = CASE WHEN
left_face = 3 THEN 4 ELSE left_face END, right_face = CASE WHEN right_face
= 3 THEN 4 ELSE right_face END WHERE ( left_face = 3 OR right_face = 3)
AND NOT edge_id = ANY ('{6,3,5,2,5}') AND NOT
ST_Contains('0103000020E6100000010000000D0000000000000000000040000000000000104000000000000000400000000000000840000000000000F03F0000000000000840000000000000F03F0000000000001040000000000000F03F00000000000014400000000000000040000000000000144000000000000000400000000000001040000000000000184000000000000000400000000000001C4000000000000000400000000000001C40000000000000F03F0000000000001840000000000000F03F0000000000001840000000000000004000000000000000400000000000001040'::geometry,
geom)"
PL/pgSQL function "_st_addfacesplit" line 114 at EXECUTE statement
SQL statement "SELECT topology._ST_AddFaceSplit(atopology,
newedge.edge_id, newedge.left_face, false)"
PL/pgSQL function "st_addedgemodface" line 510 at SQL statement
PL/pgSQL function "topogeo_addlinestring" line 124 at assignment
SQL statement "SELECT topogeo_AddLineString('wimpy', line5)"
}}}
The code:
{{{
CREATE OR REPLACE FUNCTION testerror1()
returns void as
$$
declare line1 geometry;
declare line2 geometry;
declare line3 geometry;
declare line4 geometry;
declare line5 geometry;
declare line6 geometry;
declare simpl_tol float;
begin
raise notice 'version: %', postgis_full_version();
perform CreateTopology('wimpy', 4326, 0.0000001);
simpl_tol = 0.00001;
line1 = ST_GeometryFromText(
'LINESTRING(0 0, 0 6,8 6,8 0,0 0)', 4326);
line2 = ST_GeometryFromText(
'LINESTRING(6 2,7 2,7 1,6 1,6 2)', 4326);
line3 = ST_GeometryFromText(
'LINESTRING(1 4,1 5,2 5,2 4)', 4326);
line4 = ST_GeometryFromText(
'LINESTRING(2 4,1 4)', 4326);
line5 = ST_GeometryFromText(
'LINESTRING(2 4,2 3,1 3,1 4)', 4326);
line6 = ST_GeometryFromText(
'LINESTRING(6 2,2 4)', 4326);
perform topogeo_AddLineString('wimpy', line1);
perform topogeo_AddLineString('wimpy', line2);
perform topogeo_AddLineString('wimpy', line3);
perform topogeo_AddLineString('wimpy', line4);
perform topogeo_AddLineString('wimpy', line6);
perform topogeo_AddLineString('wimpy', line5);
END
$$
LANGUAGE plpgsql;
}}}
When I insert line 5 before line 6 I don't get the error.
Also validatetopology() doesn't report errors then.
I understand that line 6 breaks proper polygon topology here, but it is
part of a face being built up.
When I have to AddLineString the complete polygon rings, I'll loose the
performance gain I have by building up in separate districts
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2025>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list