Ignore:
Timestamp:
Jan 3, 2012 1:44:10 AM (5 years ago)
Author:
strk
Message:

Don't consider shared nodes as edge intersections. Fixes #1428.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/topology/sql/sqlmm.sql

    r8626 r8648  
    25042504
    25052505  --
    2506   -- h) Check if curve intersects any other edge
    2507   --
    2508   FOR rec IN EXECUTE 'SELECT * FROM '
    2509     || quote_ident(atopology) || '.edge_data '
    2510     || ' WHERE edge_id != ' || anedge
    2511     || ' AND ST_Intersects(geom, '
    2512     || quote_literal(acurve::text) || '::geometry)'
     2506  -- h) Check if this geometry has any interaction with any existing edge
     2507  --
     2508  FOR rec IN EXECUTE 'SELECT edge_id, ST_Relate(geom,'
     2509    || quote_literal(acurve::text)
     2510    || '::geometry, 2) as im FROM '
     2511    || quote_ident(atopology)
     2512    || '.edge_data WHERE geom && '
     2513    || quote_literal(acurve::text) || '::geometry'
    25132514  LOOP
    2514     RAISE EXCEPTION
    2515     'SQL/MM Spatial exception - geometry intersects an edge';
     2515
     2516    --RAISE DEBUG 'IM=%',rec.im;
     2517
     2518    IF ST_RelateMatch(rec.im, 'F********') THEN
     2519      CONTINUE; -- no interior-interior intersection
     2520    END IF;
     2521
     2522    IF ST_RelateMatch(rec.im, '1FFF*FFF2') THEN
     2523      RAISE EXCEPTION
     2524        'SQL/MM Spatial exception - coincident edge';
     2525    END IF;
     2526
     2527    -- NOT IN THE SPECS: geometry touches an edge
     2528    IF ST_RelateMatch(rec.im, '1********') THEN
     2529      RAISE EXCEPTION
     2530        'Spatial exception - geometry intersects edge %', rec.edge_id;
     2531    END IF;
     2532
     2533    IF ST_RelateMatch(rec.im, 'T********') THEN
     2534      RAISE EXCEPTION
     2535        'SQL/MM Spatial exception - geometry crosses an edge';
     2536    END IF;
     2537
    25162538  END LOOP;
    25172539
Note: See TracChangeset for help on using the changeset viewer.