</refsection>
</refentry>
+ <refentry id="ST_ChangeEdgeGeom">
+ <refnamediv>
+ <refname>ST_ChangeEdgeGeom</refname>
+
+ <refpurpose>Changes the linestring that define the specified edge. Will raise an error if the start and end points are not the same as the original or the new linestring
+ crosses an existing edge (not add end points) or new linestring is not simple.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>integer <function>ST_ChangeEdgeGeom</function></funcdef>
+ <paramdef><type>varchar </type> <parameter>atopology</parameter></paramdef>
+ <paramdef><type>integer </type> <parameter>anedge</parameter></paramdef>
+ <paramdef><type>geometry </type> <parameter>acurve</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsection>
+ <title>Description</title>
+
+ <para>Changes the linestring that defines the specified edge. Will raise an error if the start and end points are not the same as the original or the new linestring
+ crosses an existing edge (except at end points) or intersects another edge.</para>
+ <para>If any arguments are null, the given edge does not exist in the <varname>node</varname> table of the topology schema) ,
+ the <varname>acurve</varname> is not a <varname>LINESTRING</varname>, the <varname>anode</varname> and <varname>anothernode</varname> are not the start
+ and endpoints of <varname>acurve</varname> then an error is thrown.</para>
+ <para>If the spatial reference system (srid) of the <varname>acurve</varname> geometry is not the same as the topology an exception is thrown.</para>
+ <para>If the new <varname>acurve</varname> is not simple, then an error is thrown.</para>
+
+ <!-- use this format if new function -->
+ <para>Availability: 1.x </para>
+ <para>&sqlmm_compliant; SQL-MM: Topo-Geo and Topo-Net 3: Routine Details X.3.6</para>
+ </refsection>
+
+
+ <refsection>
+ <title>Examples</title>
+ SELECT topology.ST_ChangeEdgeGeom('ma_topo', 1, ST_GeomFromText('LINESTRING(227591.9 893900.4,227622.6 893844.3,227641.6 893816.6,
+ 227704.5 893778.5)', 26986) );
+ ----
+ Edge 1 changed
+ </refsection>
+
+ <!-- Optionally add a "See Also" section -->
+ <refsection>
+ <title>See Also</title>
+ <para><xref linkend="ST_AddEdge"/></para>
+ </refsection>
+ </refentry>
+
<refentry id="ST_ModEdgeSplit">
<refnamediv>
<refname>ST_ModEdgeSplit</refname>
<refsection>
<title>See Also</title>
<para>
- <xref linkend="ST_NewEdgesSplit"/>
- <xref linkend="ST_ModEdgeHeal"/>
- <xref linkend="ST_NewEdgeHeal"/>
+ <xref linkend="ST_NewEdgesSplit"/>,
+ <xref linkend="ST_ModEdgeHeal"/>,
+ <xref linkend="ST_NewEdgeHeal"/>,
<xref linkend="AddEdge"/>
</para>
</refsection>
--
-- ST_ChangeEdgeGeom(atopology, anedge, acurve)
--
-CREATE OR REPLACE FUNCTION topology.ST_ChangeEdgeGeom(varchar, integer, geometry)
+CREATE OR REPLACE FUNCTION topology.ST_ChangeEdgeGeom(atopology varchar, anedge integer, acurve geometry)
RETURNS TEXT AS
$$
DECLARE
- atopology ALIAS FOR $1;
- anedge ALIAS FOR $2;
- acurve ALIAS FOR $3;
aface INTEGER;
face GEOMETRY;
snodegeom GEOMETRY;
--
FOR rec IN EXECUTE 'SELECT node_id FROM '
|| quote_ident(atopology) || '.node
- WHERE geom && ' || quote_literal(acurve::text) || '::geometry
- AND ST_Within(geom, ' || quote_literal(acurve::text) || '::geometry)'
+ WHERE ST_Within(geom, ' || quote_literal(acurve::text) || '::geometry)'
LOOP
RAISE EXCEPTION
'SQL/MM Spatial exception - geometry crosses a node';
FOR rec IN EXECUTE 'SELECT * FROM '
|| quote_ident(atopology) || '.edge_data '
|| ' WHERE edge_id != ' || anedge
- || ' AND geom && '
- || quote_literal(acurve::text) || '::geometry '
|| ' AND ST_Intersects(geom, '
|| quote_literal(acurve::text) || '::geometry)'
LOOP