<div dir="ltr">Hi everybody, I am new to this list and new to pgrouting.<br><br><div>I found the following TSP example <a href="http://hardwarefetish.com/513-pgrouting-dijksta-travelling-salesman-problem-tsp-with-openstreetmap">http://hardwarefetish.com/513-pgrouting-dijksta-travelling-salesman-problem-tsp-with-openstreetmap</a></div>
<div>and tried to reproduce the solution.</div><div><br></div><div>Unfortunately I always get an error message.</div><div>My DB is complaining about one of your functions.<br><br>I got my routing table from osm2po. The table has the following structure:<br>
<br>1;â€idâ€;â€integerâ€<br>2;â€osm_idâ€;â€bigintâ€<br>3;â€osm_nameâ€;â€character varyingâ€<br>4;â€osm_metaâ€;â€character varyingâ€<br>5;â€osm_source_idâ€;â€bigintâ€<br>6;â€osm_target_idâ€;â€bigintâ€;<br>7;â€clazzâ€;â€integerâ€<br>8;â€flagsâ€;â€integerâ€<br>
9;â€sourceâ€;â€integerâ€<br>10;â€targetâ€;â€integerâ€<br>11;â€lengthâ€;â€double precisionâ€<br>12;â€kmhâ€;â€integerâ€<br>13;â€costâ€;â€double precisionâ€<br>14;â€reverse_costâ€;â€double precisionâ€<br>15;â€x1″;â€double precisionâ€<br>16;â€y1″;â€double precisionâ€<br>
17;â€x2″;â€double precisionâ€<br>18;â€y2″;â€double precisionâ€<br>19;â€geom_wayâ€;â€geometry(LineString,4326)â€<br><br>- I installed the functions as mentioned via SQL window in pgAdmin3 (copy&paste then excecute)<br>- I create and populate the my_route table<br>
- When it comes to step 5 and I try<br><br>select id,lon,lat from pgr_tspDijkstraLen(’my_route’, 1260<br>) dj, my_route rt where dj.id2=rt.node;<br><br>my DB warns<br><br>ERROR: cannot concatenate incompatible arrays<br>DETAIL: Arrays with differing element dimensions are not compatible for concatenation.<br>
CONTEXT: PL/pgSQL function “pgr_makedijkstramatrix†line 25 at assignment PL/pgSQL function “pgr_tspdijkstra†line 8 at RETURN QUERY<br>PL/pgSQL function “pgr_tspdijkstralen†line 3 at RETURN QUERY<br><br>********** Fehler **********<br>
<br>ERROR: cannot concatenate incompatible arrays SQL Status:2202E<br>Detail:Arrays with differing element dimensions are not compatible for concatenation.<br>Kontext:PL/pgSQL function “pgr_makedijkstramatrix†line 25 at assignment PL/pgSQL function “pgr_tspdijkstra†line 8 at RETURN QUERY<br>
PL/pgSQL function “pgr_tspdijkstralen†line 3 at RETURN QUERY<br><br>Do you have any idea what went wrong? I really really need your solutionget working. I would appreciate a lot.</div><div><br></div><div>Thanks for your help.</div>
<div><br></div><div>PS: this text is a copy of what I wrote on on the comment site of the blog where I found the solution.</div><div><br></div><div>BR</div><div>Carsten</div></div>