pgr_astar and impossible edges (e.g., locked doors)
问题 I'm using postgresql / PostGIS with pgrouting and I need to compute the shortest path. In a previous version of pgrouting, I was using shortest_path_astar. In my routing graph I had impossible segments, such as locked doors. I used: SELECT id FROM shortest_path_astar('SELECT edge_id AS id, vertex_id1 AS source, vertex_id2 AS target, ' || '(CASE WHEN door = ''S'' THEN -1.0 ELSE (length) ) END)::float8 AS cost, ' || '(CASE WHEN door_rev = ''S'' THEN -1.0 ELSE (length) ) END )::float8 AS reverse