pgRouting

Changeset 97

Show
Ignore:
Timestamp:
01/21/08 16:28:04 (11 months ago)
Author:
anton
Message:

tsp functions fixed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/extra/tsp/sql/routing_tsp_wrappers.sql

    r54 r97  
    4747 
    4848CREATE OR REPLACE FUNCTION tsp_astar( 
    49        geom_table varchar,ids varchar, source integer)  
     49       geom_table varchar,ids varchar, source integer, delta double precision)  
    5050       RETURNS SETOF GEOMS AS 
    5151$$ 
     
    7070                FOR r IN EXECUTE 'SELECT gid, the_geom FROM astar_sp_delta( ''' ||  
    7171                  quote_ident(geom_table)  ||''', '|| v_id ||', '||  
    72                   prev ||',0.03)' LOOP 
     72                  prev ||','||delta||')' LOOP 
    7373                    geom.gid := r.gid; 
    7474                    geom.the_geom := r.the_geom; 
     
    104104        prev := source; 
    105105        query := 'SELECT vertex_id FROM tsp(''select distinct source::integer '|| 
    106                 'as source_id, x1::double precision as x, y1::double precision as y'; 
     106                'as source_id, x1::double precision as x, y1::double precision as y '; 
    107107                 
    108108        IF rc THEN query := query || ' , reverse_cost '; 
     
    200200        END IF; 
    201201 
    202         query := 'from ' || quote_ident(geom_table) || ' where source in (' ||  
     202        query := ' from ' || quote_ident(geom_table) || ' where source in (' ||  
    203203           ids || ')'', '''|| ids  ||''', '|| source  ||')'; 
    204204