Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am a newbie with postgresql and sql statements so maybe it is a trivial question, I'm sorry for that.

I am working on a postgis database and try to use the pgrouting function. My goal is to store the results of the shortest path query in a different table than the original one, which is working so far. The problem is, that it keeps adding the results to the original table too, so there are duplicate values in it afterwards, which I try to avoid but without success so far. I don't know if it should be like this? Anyway can you suggest any solutions to this problem? (I solved it so far so that I delete the duplicate values afterwards, but I really want my database to stay unedited... is it even possible?)

I am using postgresql 8.4 with postgis 1.5 and pgrouting 1.05

This is my query:

 INSERT INTO
route (

SELECT
topo.id,
topo.osm_id,
topo.osm_name,
topo.osm_source_id,
topo.osm_target_id,
topo.clazz,
topo.flags,
topo.source,
topo.target,
topo.km,
topo.kmh,
topo.cost,
topo.reverse_cost,
topo.x1,
topo.y1,
topo.x2,
topo.y2,
topo.geom_way,
topo.available

FROM
Shortest_path('select
*
from
testro_2po_4pgr',
2345,
9234,
false,
true)
AS path,
testro_2po_4pgr
AS
topo
WHERE
path.edge_id=topo.id);

Thank you very much in advance!

share|improve this question
    
It seems that it was an other sql query which made this bug, you can delete this question sorry for the troubles! –  eger Sep 19 '12 at 11:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.