[pgrouting-users] pgrouting Dijksta Travelling Salesman Problem (TSP) with OpenStreetmap

Carsten Hogertz carsten.hogertz at gmail.com
Thu Feb 20 06:21:56 PST 2014


Hi everybody, I am new to this list and new to pgrouting.

I found the following TSP example
http://hardwarefetish.com/513-pgrouting-dijksta-travelling-salesman-problem-tsp-with-openstreetmap
and tried to reproduce the solution.

Unfortunately I always get an error message.
My DB is complaining about one of your functions.

I got my routing table from osm2po. The table has the following structure:

1;”id”;”integer”
2;”osm_id”;”bigint”
3;”osm_name”;”character varying”
4;”osm_meta”;”character varying”
5;”osm_source_id”;”bigint”
6;”osm_target_id”;”bigint”;
7;”clazz”;”integer”
8;”flags”;”integer”
9;”source”;”integer”
10;”target”;”integer”
11;”length”;”double precision”
12;”kmh”;”integer”
13;”cost”;”double precision”
14;”reverse_cost”;”double precision”
15;”x1″;”double precision”
16;”y1″;”double precision”
17;”x2″;”double precision”
18;”y2″;”double precision”
19;”geom_way”;”geometry(LineString,4326)”

- I installed the functions as mentioned via SQL window in pgAdmin3
(copy&paste then excecute)
- I create and populate the my_route table
- When it comes to step 5 and I try

select id,lon,lat from pgr_tspDijkstraLen(’my_route’, 1260
) dj, my_route rt where dj.id2=rt.node;

my DB warns

ERROR: cannot concatenate incompatible arrays
DETAIL: Arrays with differing element dimensions are not compatible for
concatenation.
CONTEXT: PL/pgSQL function “pgr_makedijkstramatrix” line 25 at assignment
PL/pgSQL function “pgr_tspdijkstra” line 8 at RETURN QUERY
PL/pgSQL function “pgr_tspdijkstralen” line 3 at RETURN QUERY

********** Fehler **********

ERROR: cannot concatenate incompatible arrays SQL Status:2202E
Detail:Arrays with differing element dimensions are not compatible for
concatenation.
Kontext:PL/pgSQL function “pgr_makedijkstramatrix” line 25 at assignment
PL/pgSQL function “pgr_tspdijkstra” line 8 at RETURN QUERY
PL/pgSQL function “pgr_tspdijkstralen” line 3 at RETURN QUERY

Do you have any idea what went wrong? I really really need your solutionget
working. I would appreciate a lot.

Thanks for your help.

PS: this text is a copy of what I wrote on on the comment site of the blog
where I found the solution.

BR
Carsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20140220/8edae555/attachment.html>


More information about the Pgrouting-users mailing list