|| ' WHERE element_type = 1 AND element_id = '
|| start_node LIMIT 1 INTO visited;
IF visited IS NOT NULL THEN
- gml = gml || ' xlink:xref="N' || start_node || '" />';
+ gml = gml || ' xlink:href="#N' || start_node || '" />';
ELSE
-- Mark as visited
EXECUTE 'INSERT INTO ' || visitedTable::text
|| ' WHERE element_type = 1 AND element_id = '
|| end_node LIMIT 1 INTO visited;
IF visited IS NOT NULL THEN
- gml = gml || ' xlink:xref="N' || end_node || '" />';
+ gml = gml || ' xlink:href="#N' || end_node || '" />';
ELSE
-- Mark as visited
EXECUTE 'INSERT INTO ' || visitedTable::text
|| ' WHERE element_type = 1 AND element_id = '
|| rec.element_id LIMIT 1 INTO visited;
IF visited IS NOT NULL THEN
- gml = gml || ' xlink:xref="N' || rec.element_id || '" />';
+ gml = gml || ' xlink:href="#N' || rec.element_id || '" />';
CONTINUE;
ELSE
-- Mark as visited
|| ' WHERE element_type = 2 AND element_id = '
|| rec2.edge_id LIMIT 1 INTO visited;
IF visited THEN
- -- Use xlink:xref if visited
- gml = gml || ' xlink:xref="#E' || rec2.edge_id || '" />';
+ -- Use xlink:href if visited
+ gml = gml || ' xlink:href="#E' || rec2.edge_id || '" />';
CONTINUE;
ELSE
-- Mark as visited otherwise
|| ' WHERE element_type = 2 AND element_id = '
|| rec2.edge_id LIMIT 1 INTO visited;
IF visited THEN
- -- Use xlink:xref if visited
- gml = gml || ' xlink:xref="#E' || rec2.edge_id || '" />';
+ -- Use xlink:href if visited
+ gml = gml || ' xlink:href="#E' || rec2.edge_id || '" />';
CONTINUE;
ELSE
-- Mark as visited otherwise
P1-customprefix|<cstm:TopoSurface><cstm:directedFace><cstm:Face><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E20"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N9"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N14"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">21 6 21 14</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E12"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N8"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N9"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">9 6 21 6</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E22"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N8"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N15"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">9 6 9 14</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E21"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N15"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N16"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">9 14 9 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E6"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N16"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N17"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">9 22 21 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E19"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N14"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N17"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">21 14 21 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge></cstm:Face></cstm:directedFace></cstm:TopoSurface>
P2-customprefix|<cstm:TopoSurface><cstm:directedFace><cstm:Face><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E18"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N10"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N13"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">35 6 35 14</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E13"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N9"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N10"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">21 6 35 6</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E20"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N9"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N14"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">21 6 21 14</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E19"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N14"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N17"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">21 14 21 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E7"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N17"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N18"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">21 22 35 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E17"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N13"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N18"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">35 14 35 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge></cstm:Face></cstm:directedFace></cstm:TopoSurface>
P3-customprefix|<cstm:TopoSurface><cstm:directedFace><cstm:Face><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E16"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N11"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N12"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">47 6 47 14</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E14"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N10"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N11"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">35 6 47 6</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E18"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N10"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N13"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">35 6 35 14</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E17"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N13"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N18"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">35 14 35 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge><cstm:Edge cstm:id="E8"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N18"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N19"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">35 22 47 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge><cstm:directedEdge orientation="-"><cstm:Edge cstm:id="E15"><cstm:directedNode orientation="-"><cstm:Node cstm:id="N12"/></cstm:directedNode><cstm:directedNode><cstm:Node cstm:id="N19"/></cstm:directedNode><cstm:curveProperty><cstm:Curve srsName="urn:ogc:def:crs:EPSG::4326"><cstm:segments><cstm:LineStringSegment><cstm:posList srsDimension="2">47 14 47 22</cstm:posList></cstm:LineStringSegment></cstm:segments></cstm:Curve></cstm:curveProperty></cstm:Edge></cstm:directedEdge></cstm:Face></cstm:directedFace></cstm:TopoSurface>
-R2-visited|<TopoCurve><directedEdge><Edge id="E4"><directedNode orientation="-"><Node id="N5"/></directedNode><directedNode><Node id="N6"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>36 38 38 35 41 34 42 33 45 32 47 28 50 28 52 32 57 33</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E5"><directedNode orientation="-"><Node id="N7"/></directedNode><directedNode xlink:xref="N6" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>41 40 45 40 47 42 62 41 61 38 59 39 57 36 57 33</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></TopoCurve>
+R2-visited|<TopoCurve><directedEdge><Edge id="E4"><directedNode orientation="-"><Node id="N5"/></directedNode><directedNode><Node id="N6"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>36 38 38 35 41 34 42 33 45 32 47 28 50 28 52 32 57 33</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E5"><directedNode orientation="-"><Node id="N7"/></directedNode><directedNode xlink:href="#N6" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>41 40 45 40 47 42 62 41 61 38 59 39 57 36 57 33</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></TopoCurve>
S1-visited|<TopoPoint><directedNode><Node id="N14"><pointProperty><Point srsName="EPSG:4326"><pos>21 14</pos></Point></pointProperty></Node></directedNode></TopoPoint>
-S3-visited|<TopoPoint><directedNode xlink:xref="N6" /></TopoPoint>
-R1-visited|<TopoCurve><directedEdge><Edge id="E9"><directedNode orientation="-"><Node id="N15"/></directedNode><directedNode xlink:xref="N14" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 14 21 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E10"><directedNode orientation="-"><Node id="N13"/></directedNode><directedNode xlink:xref="N14" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>35 14 21 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></TopoCurve>
-P2-visited|<TopoSurface><directedFace><Face><directedEdge orientation="-"><Edge id="E18"><directedNode orientation="-"><Node id="N10"/></directedNode><directedNode xlink:xref="N13" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>35 6 35 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E13"><directedNode orientation="-" xlink:xref="N9" /><directedNode xlink:xref="N10" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 6 35 6</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge xlink:xref="#E20" /><directedEdge xlink:xref="#E19" /><directedEdge><Edge id="E7"><directedNode orientation="-" xlink:xref="N17" /><directedNode><Node id="N18"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 22 35 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E17"><directedNode orientation="-" xlink:xref="N13" /><directedNode xlink:xref="N18" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>35 14 35 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></Face></directedFace></TopoSurface>
-P1-visited|<TopoSurface><directedFace><Face><directedEdge orientation="-"><Edge id="E20"><directedNode orientation="-"><Node id="N9"/></directedNode><directedNode xlink:xref="N14" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 6 21 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E12"><directedNode orientation="-"><Node id="N8"/></directedNode><directedNode xlink:xref="N9" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 6 21 6</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge><Edge id="E22"><directedNode orientation="-" xlink:xref="N8" /><directedNode xlink:xref="N15" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 6 9 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge><Edge id="E21"><directedNode orientation="-" xlink:xref="N15" /><directedNode><Node id="N16"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 14 9 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge><Edge id="E6"><directedNode orientation="-" xlink:xref="N16" /><directedNode><Node id="N17"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 22 21 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E19"><directedNode orientation="-" xlink:xref="N14" /><directedNode xlink:xref="N17" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 14 21 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></Face></directedFace></TopoSurface>
+S3-visited|<TopoPoint><directedNode xlink:href="#N6" /></TopoPoint>
+R1-visited|<TopoCurve><directedEdge><Edge id="E9"><directedNode orientation="-"><Node id="N15"/></directedNode><directedNode xlink:href="#N14" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 14 21 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E10"><directedNode orientation="-"><Node id="N13"/></directedNode><directedNode xlink:href="#N14" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>35 14 21 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></TopoCurve>
+P2-visited|<TopoSurface><directedFace><Face><directedEdge orientation="-"><Edge id="E18"><directedNode orientation="-"><Node id="N10"/></directedNode><directedNode xlink:href="#N13" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>35 6 35 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E13"><directedNode orientation="-" xlink:href="#N9" /><directedNode xlink:href="#N10" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 6 35 6</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge xlink:href="#E20" /><directedEdge xlink:href="#E19" /><directedEdge><Edge id="E7"><directedNode orientation="-" xlink:href="#N17" /><directedNode><Node id="N18"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 22 35 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E17"><directedNode orientation="-" xlink:href="#N13" /><directedNode xlink:href="#N18" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>35 14 35 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></Face></directedFace></TopoSurface>
+P1-visited|<TopoSurface><directedFace><Face><directedEdge orientation="-"><Edge id="E20"><directedNode orientation="-"><Node id="N9"/></directedNode><directedNode xlink:href="#N14" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 6 21 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E12"><directedNode orientation="-"><Node id="N8"/></directedNode><directedNode xlink:href="#N9" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 6 21 6</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge><Edge id="E22"><directedNode orientation="-" xlink:href="#N8" /><directedNode xlink:href="#N15" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 6 9 14</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge><Edge id="E21"><directedNode orientation="-" xlink:href="#N15" /><directedNode><Node id="N16"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 14 9 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge><Edge id="E6"><directedNode orientation="-" xlink:href="#N16" /><directedNode><Node id="N17"/></directedNode><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>9 22 21 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge><directedEdge orientation="-"><Edge id="E19"><directedNode orientation="-" xlink:href="#N14" /><directedNode xlink:href="#N17" /><curveProperty><Curve srsName="EPSG:4326"><segments><LineStringSegment><posList>21 14 21 22</posList></LineStringSegment></segments></Curve></curveProperty></Edge></directedEdge></Face></directedFace></TopoSurface>
Topology 'city_data' dropped