Make RemEdgeModFace symmetric to AddEdgeModFace about face retention

Save the face on the right, so that running:
ST_RemEdgeModFace(name, ST_AddEdgeModFace(name, ...))
... will not modify the topology.
[RT-SIGTA]

git-svn-id: http://svn.osgeo.org/postgis/trunk@7878 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2011-09-21 07:32:32 +00:00
parent a8f65ae89b
commit d5ac843103
3 changed files with 53 additions and 69 deletions

View file

@ -1714,6 +1714,7 @@ Updates all existing joined edges and relationships accordingly.
<!-- Optionally add a "See Also" section -->
<refsection>
<title>See Also</title>
<para><xref linkend="ST_RemEdgeNewFace"/></para>
<para><xref linkend="ST_AddEdgeModFace"/></para>
</refsection>
</refentry>
@ -1743,7 +1744,7 @@ Updates all existing joined edges and relationships accordingly.
<para>
Add a new edge and, if in doing so it splits a face, modify the original
face and add a new face. Unless the face being split is the Universal Face,
the new edge will be on the right side of the newly added edge.
the new face will be on the right side of the newly added edge.
Returns the id of the newly added edge.
</para>
@ -1769,6 +1770,7 @@ Updates all existing joined edges and relationships accordingly.
<!-- Optionally add a "See Also" section -->
<refsection>
<title>See Also</title>
<para><xref linkend="ST_RemEdgeModFace"/></para>
<para><xref linkend="ST_AddEdgeNewFaces"/></para>
</refsection>
</refentry>
@ -1841,7 +1843,6 @@ name is invalid then an error is thrown.
<title>See Also</title>
<para><xref linkend="ST_RemEdgeModFace"/></para>
<para><xref linkend="ST_AddEdgeNewFaces"/></para>
<para><xref linkend="ST_AddEdgeModFace"/></para>
</refsection>
</refentry>
@ -1851,8 +1852,7 @@ name is invalid then an error is thrown.
<refpurpose>
Removes an edge and, if the removed edge separated two faces,
delete one of the faces and modify the other to include the space
covered by the other.
delete one of the them and modify the other to take the space of both.
</refpurpose>
</refnamediv>
@ -1871,8 +1871,9 @@ covered by the other.
<para>
Removes an edge and, if the removed edge separated two faces,
delete one of the faces and modify the other to include the space
covered by the other.
delete one of the them and modify the other to take the space of both.
Preferencially keeps the face on the right, to be symmetric with
ST_AddEdgeModFace also keeping it.
Returns the id of the face remaining in place of the removed edge.
</para>
@ -1907,9 +1908,8 @@ name is invalid then an error is thrown.
<!-- Optionally add a "See Also" section -->
<refsection>
<title>See Also</title>
<para><xref linkend="ST_RemEdgeNewFace"/></para>
<para><xref linkend="ST_AddEdgeNewFaces"/></para>
<para><xref linkend="ST_AddEdgeModFace"/></para>
<para><xref linkend="ST_RemEdgeNewFace"/></para>
</refsection>
</refentry>

View file

@ -1203,9 +1203,9 @@ BEGIN
ELSE -- }{
-- we arbitrarely choose left face as the face that
-- will remain (it'll be "left" there ...)
floodfaceid = e1rec.left_face;
-- we choose right face as the face that will remain
-- to be symmetric with ST_AddEdgeModFace
floodfaceid = e1rec.right_face;
sql := 'UPDATE '
|| quote_ident(toponame)
@ -1286,7 +1286,7 @@ BEGIN
IF e1rec.right_face != e1rec.left_face THEN -- {
-- Delete left face, if not universe
-- Delete left face, if not universe and not "flood" face
IF e1rec.left_face != 0 AND e1rec.left_face != floodfaceid
THEN
sql := 'DELETE FROM ' || quote_ident(toponame)
@ -1295,7 +1295,7 @@ BEGIN
EXECUTE sql;
END IF;
-- Delete right face, if not universe
-- Delete right face, if not universe and not "flood" face
IF e1rec.right_face != 0 AND e1rec.right_face != floodfaceid
THEN
sql := 'DELETE FROM ' || quote_ident(toponame)

View file

@ -21,80 +21,64 @@ RM(4)/nodes|-|5|
RM(4)/edges|-|4|-5|4|0|0
RM(4)/edges|+|5|-5|5|0|0
RM(4)/edges|-|5|-4|5|0|0
RM(26)|9
RM(26)/nodes|+|20|9
RM(26)|1
RM(26)/nodes|+|20|1
RM(26)/nodes|-|20|
RM(26)/nodes|+|21|9
RM(26)/nodes|-|21|1
RM(26)/nodes|+|22|9
RM(26)/nodes|-|22|1
RM(26)/edges|+|1|1|-1|9|0
RM(26)/edges|-|1|1|-1|1|0
RM(26)/edges|-|26|26|-26|9|1
RM(26)/faces|-|1|SRID=4326;POLYGON((3 30,3 38,16 38,16 30,3 30))
RM(26)/faces|+|9|SRID=4326;POLYGON((3 30,3 38,16 38,16 30,3 30))
RM(26)/faces|-|9|SRID=4326;POLYGON((4 31,4 34,7 34,7 31,4 31))
RM(9)|3
RM(9)|6
RM(9)/edges|+|6|7|-21|0|6
RM(9)/edges|-|6|7|-21|0|3
RM(9)/edges|-|9|19|-22|3|6
RM(9)/edges|+|12|20|22|3|0
RM(9)/edges|-|12|20|22|6|0
RM(9)/edges|+|20|19|13|3|7
RM(9)/edges|+|19|-6|-10|6|4
RM(9)/edges|-|19|-6|-10|3|4
RM(9)/edges|+|20|19|13|6|7
RM(9)/edges|-|20|-9|13|6|7
RM(9)/edges|+|21|6|-22|0|3
RM(9)/edges|+|21|6|-22|0|6
RM(9)/edges|-|21|6|9|0|3
RM(9)/edges|+|22|21|12|0|3
RM(9)/edges|-|22|21|12|0|6
RM(9)/faces|+|3|SRID=4326;POLYGON((9 6,9 22,21 22,21 6,9 6))
RM(9)/faces|-|3|SRID=4326;POLYGON((9 14,9 22,21 22,21 14,9 14))
RM(9)/faces|+|6|SRID=4326;POLYGON((9 6,9 22,21 22,21 6,9 6))
RM(9)/faces|-|6|SRID=4326;POLYGON((9 6,9 14,21 14,21 6,9 6))
RM(19)|3
RM(19)/edges|+|7|8|-6|0|3
RM(19)|4
RM(19)/edges|+|6|7|-21|0|4
RM(19)/edges|-|6|7|-21|0|6
RM(19)/edges|+|7|8|-6|0|4
RM(19)/edges|-|7|8|-19|0|4
RM(19)/edges|+|10|-20|17|7|3
RM(19)/edges|-|10|-20|17|7|4
RM(19)/edges|+|17|-7|11|3|5
RM(19)/edges|-|17|-7|11|4|5
RM(19)/edges|-|19|-6|-10|3|4
RM(19)/edges|+|20|-10|13|3|7
RM(19)/edges|-|20|19|13|3|7
RM(19)/faces|+|3|SRID=4326;POLYGON((9 6,9 22,35 22,35 6,9 6))
RM(19)/faces|-|3|SRID=4326;POLYGON((9 6,9 22,21 22,21 6,9 6))
RM(19)/edges|+|12|20|22|4|0
RM(19)/edges|-|12|20|22|6|0
RM(19)/edges|-|19|-6|-10|6|4
RM(19)/edges|+|20|-10|13|4|7
RM(19)/edges|-|20|19|13|6|7
RM(19)/edges|+|21|6|-22|0|4
RM(19)/edges|-|21|6|-22|0|6
RM(19)/edges|+|22|21|12|0|4
RM(19)/edges|-|22|21|12|0|6
RM(19)/faces|+|4|SRID=4326;POLYGON((9 6,9 22,35 22,35 6,9 6))
RM(19)/faces|-|4|SRID=4326;POLYGON((21 14,21 22,35 22,35 14,21 14))
RM(10)|7
RM(10)/edges|+|6|7|-21|0|7
RM(10)/edges|-|6|7|-21|0|3
RM(10)/edges|+|7|8|-6|0|7
RM(10)/edges|-|7|8|-6|0|3
RM(10)/edges|-|10|-20|17|7|3
RM(10)/edges|+|12|20|22|7|0
RM(10)/edges|-|12|20|22|3|0
RM(10)/edges|+|17|-7|11|7|5
RM(10)/edges|-|17|-7|11|3|5
RM(10)/edges|+|18|17|14|7|8
RM(19)/faces|-|6|SRID=4326;POLYGON((9 6,9 22,21 22,21 6,9 6))
RM(10)|4
RM(10)/edges|-|10|-20|17|7|4
RM(10)/edges|+|13|18|-12|4|0
RM(10)/edges|-|13|18|-12|7|0
RM(10)/edges|+|18|17|14|4|8
RM(10)/edges|-|18|10|14|7|8
RM(10)/edges|+|20|-20|13|7|7
RM(10)/edges|-|20|-10|13|3|7
RM(10)/edges|+|21|6|-22|0|7
RM(10)/edges|-|21|6|-22|0|3
RM(10)/edges|+|22|21|12|0|7
RM(10)/edges|-|22|21|12|0|3
RM(10)/faces|-|3|SRID=4326;POLYGON((9 6,9 22,35 22,35 6,9 6))
RM(10)/faces|+|7|SRID=4326;POLYGON((9 6,9 22,35 22,35 6,9 6))
RM(10)/edges|+|20|-20|13|4|4
RM(10)/edges|-|20|-10|13|4|7
RM(10)/faces|-|7|SRID=4326;POLYGON((21 6,21 14,35 14,35 6,21 6))
RM(20)|7
RM(20)/nodes|+|14|7
RM(20)|4
RM(20)/nodes|+|14|4
RM(20)/nodes|-|14|
RM(20)/edges|+|12|13|22|7|0
RM(20)/edges|-|12|20|22|7|0
RM(20)/edges|-|20|-20|13|7|7
RM(20)/edges|+|12|13|22|4|0
RM(20)/edges|-|12|20|22|4|0
RM(20)/edges|-|20|-20|13|4|4
RM(15)|0
RM(15)/edges|+|8|-8|-17|0|0
RM(15)/edges|-|8|-15|-17|0|5
RM(15)/edges|+|11|-16|-18|0|8
RM(15)/edges|-|11|15|-18|5|8
RM(15)/edges|-|15|-8|-16|5|0
RM(15)/edges|+|17|-7|11|7|0
RM(15)/edges|-|17|-7|11|7|5
RM(15)/edges|+|17|-7|11|4|0
RM(15)/edges|-|17|-7|11|4|5
RM(15)/faces|-|5|SRID=4326;POLYGON((35 14,35 22,47 22,47 14,35 14))
RM(2)|0
RM(2)/nodes|+|4|0
@ -217,7 +201,7 @@ ERROR: TopoGeom 2 in layer 3 (features.city_streets.feature) cannot be represen
ERROR: TopoGeom 2 in layer 3 (features.city_streets.feature) cannot be represented dropping edge 5
ERROR: TopoGeom 2 in layer 1 (features.land_parcels.feature) cannot be represented healing faces 5 and 4
RM(11)|relations_before:|18
RM(11)|5
RM(11)|8
RM(11)|relations_after:|17
RM(11)|P1|t
RM(11)|P2|t