Opened 9 years ago

Closed 3 years ago

#3205 closed defect (wontfix)

missing output for TopoGeo_AddLineString

Reported by: remic Owned by: strk
Priority: medium Milestone: PostGIS 3.0.3
Component: topology Version: 2.1.x
Keywords: Cc:

Description (last modified by robe)

it seems like the return of TopoGeo_AddLineString is missing something.

here is the script (bottom)

The error in TopoGeo_AddLineString seems to be ligne 90 94 "start_node := topology.TopoGeo_AddPoint" From what I understood, topogeo_addpoint has the ability to split edges, but we don't have any way to get the edge_id of the split edge by addpoint.

I don't see an easy workaround (would need to modify topogeo_addpoint to return edge_id, which is a big API change). The simplest would be to check before addpoint if the point is going to split, then if yes save edge_id already existing, addpoint, then look for thhe new edge_id resulting from the split. There would be worysome cornercase (what if addpoint is used on top of an existing node)


SELECT DropTopology('test_postgis_topology');
SELECT CreateTopology('test_postgis_topology',0,0.1,false); --2

DROP TABLE IF EXISTS  test_postgis_topology.test_topogeo_linestring ;
CREATE TABLE test_postgis_topology.test_topogeo_linestring AS
SELECT 1 AS gid, 'id1' AS id,ST_GeomFromtext('LINESTRING(0 0 , 10 10)',0) AS geom
UNION
SELECT 2 AS gid, 'id2' AS id, ST_GeomFromtext('LINESTRING(0 10 , 10 0)',0) ;

WITH result_addlinestring AS (
SELECT id,  topology.TopoGeo_AddLineString(
                'test_postgis_topology'
                , geom
                , 0.01) as edge_id
    FROM test_postgis_topology.test_topogeo_linestring
)
SELECT count(*) = 4 AS is_TopoGeo_AddLineString_working
FROM (SELECT DISTINCT * FROM result_addlinestring) AS sub ;

DROP TABLE IF EXISTS  test_postgis_topology.test_topogeo_linestring ;
SELECT DropTopology('test_postgis_topology');

The function should return 4 different edge_ids, which it does not.

Hint for workaround : post processing, looking for edge_id that have not been returned, with surface distance

SELECT DISTINCT ON (pe.edge_id) edge_id, gid
    FROM problematic_edges AS pe, my_source_lines AS ul
    WHERE ST_DWithin(pe.geom,t,1) = TRUE
    ORDER BY pe.edge_id, ST_Area(ST_Intersection(ST_Buffer(pe.geom,1,'quad_segs=2'),ST_Buffer(ul,1,'quad_segs=2'))) DESC

Change History (11)

comment:1 by robe, 9 years ago

Description: modified (diff)

comment:2 by robe, 9 years ago

Description: modified (diff)

comment:3 by pramsey, 6 years ago

Milestone: PostGIS 2.1.9PostGIS 2.2.6

comment:4 by pramsey, 6 years ago

Milestone: PostGIS 2.2.6PostGIS 2.2.7

comment:5 by robe, 6 years ago

Milestone: PostGIS 2.2.7PostGIS 2.2.8

comment:6 by Algunenano, 5 years ago

Milestone: PostGIS 2.2.8PostGIS 2.3.10

Moving to a non EOL release.

comment:7 by robe, 5 years ago

Milestone: PostGIS 2.3.10PostGIS 2.5.4

comment:8 by pramsey, 4 years ago

Milestone: PostGIS 2.5.4PostGIS 2.5.5

comment:9 by robe, 4 years ago

Is this still a thing?

comment:10 by robe, 4 years ago

Milestone: PostGIS 2.5.5PostGIS 3.0.3

comment:11 by robe, 3 years ago

Resolution: wontfix
Status: newclosed

This has been going on for 5 years. I have no idea if it's still an issue. Closing as a wontfix

Note: See TracTickets for help on using tickets.