#1650 closed defect (fixed)
Invalid edge (no two distinct vertices exist)
Reported by: | lrssvt | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.0 |
Component: | topology | Version: | 2.0.x |
Keywords: | Cc: |
Description
Running script toleranceDemoTopo.sql i get:
ERROR: Invalid edge (no two distinct vertices exist) SQL state: P0001 Context: PL/pgSQL function "topogeo_addlinestring" line 147 at assignment SQL statement "INSERT INTO test_topo.relation(topogeo_id, layer_id, element_type, element_id) SELECT 1, 1, 2, topogeo_addLineString('test_topo', '01020000201555000003000000329ABD50D7F92041C6FE24DDB5AF014159102D22D7F92041DDB54250BBAF0141FC05F508D7F9204144A619EEC2AF0141'::geometry, 2);" PL/pgSQL function "totopogeom" line 120 at EXECUTE statement
i'm passing the value 2 as tolerance in CreateTopology function.
Attachments (3)
Change History (18)
by , 13 years ago
Attachment: | toleranceDemoTopo.sql added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
For the record, shorter form:
select createTopology('tt'); select topogeo_addlinestring('tt', 'LINESTRING(0 0,0 1)', 2);
follow-up: 4 comment:3 by , 13 years ago
I'd pick 4. (Add a single node to the topology, return an EMPTY TopoGeometry)
comment:4 by , 13 years ago
Replying to strk:
I'd pick 4. (Add a single node to the topology, return an EMPTY TopoGeometry)
yes! it is probably not a bug!
<future_development> you have to understand what the end user wants. In this direction, we can think of a GUI (like qgis plugin) in the future. Possibly with the addition of creating topologies for two related geometries (for example line and polygon), create rules and set the ranks! </future_development>
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
r9407 implements returning EMPTY on collapsed edge. Future development discussion is welcome but better on the list (or separate ticket)
comment:6 by , 13 years ago
r9408 does it better, skipping _only_ the collapsed portion of a possibly multi-edge line
by , 13 years ago
Attachment: | dongleNode.png added |
---|
follow-up: 9 comment:7 by , 13 years ago
follow-up: 11 comment:8 by , 13 years ago
I can see that possibly happening, show the input, the tolerance and some measures as well ?
comment:9 by , 13 years ago
comment:10 by , 13 years ago
The GEOS Snap operation could probably do something better than it does now, see: http://trac.osgeo.org/geos/ticket/501
by , 13 years ago
Attachment: | topoPipes.png added |
---|
comment:11 by , 13 years ago
Replying to strk:
I can see that possibly happening, show the input, the tolerance and some measures as well ?
I simply run the attached script, I have not changed anything!
Topology (in red, edge and node) and Feature "pipes" (blue)
comment:12 by , 13 years ago
The vertical line is shorter than 2 units, which is the tolerance you are using. It collapses to a single point, which is added as expected (Add a single node to the topology, return an EMPTY TopoGeometry).
Then the horizontal line is added. I've to admit in this case the horizontal line should be snapped to the node... not sure why it isn't. Worth another ticket !
comment:13 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This is the query with unexpected result:
psql:toleranceDemoTopo.sql:18: DEBUG: SELECT a.node_id FROM test_topo.node as a WHERE ST_DWithin(a.geom,' 010100002015550000BAF06A7E96F92041CD9B5862AAAF0141'::geometry,2) ORDER BY ST_Distance('010100002015550000B AF06A7E96F92041CD9B5862AAAF0141'::geometry, a.geom) LIMIT 1; psql:toleranceDemoTopo.sql:18: DEBUG: No existing node within tolerance distance
I'd expect the node that belongs to the first edge to be within distance 2 instead !
comment:14 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Sorry, I take it back, that's not the query. I'll wait for a separate ticket to deal with this. It's about adding an edge failing to snap to an existing node. To reproduce: add one point, then add a line which is within tolerance distance from the point.
One of your edges is shorter than 2, what do you think postgis should do in that case ?
I guess these are the options:
Note that a Puntal TopoGeometry will fail to be inserted into a Lineal layer.
I'm not sure this is to be considered a bug.