<div dir="ltr"><div><div><div><div>Thanks Steve,<br><br></div>coming home and adding your lines it returns with an error:<br><br>NOTICE:  r2: (34304,"{0,5.3602868897,4.6782573327,5.6026971537,5.2062747797,5.0497181017,5.3147719797,5.0700916462,4.3220066797,4.8593618137,4.0002255227,6.055760592,12.5155379824,9.3170226155,8.72783427270001,5.9460446587,3.0868131677,5.1839796057,5.2301666167,2.1211198847,5.7037465591,2.7282842677,8.4758437557,11.1027935904,7.9434273599,7.8361619299,7.7610621969,7.4929139614,5.8106133327,5.9579132527,5.9888473034,6.5618433959,4.5013708887,1.9218516244,5.7559805232,5.2267081177,5.0968196707,4.8949133597,5.9137964962,4.2936059427,4.6948533593,3.4377318427,3.7991617067,4.1242444467,3.8858731777,3.9596393887,4.9192685996,4.6734033563,4.7511846457,4.4544981945,4.2748693367,3.411559417,6.6851381985,6.6744741285,6.9296475385,7.0136847108,7.1371500908,7.2719520708,6.6787720528,7.3530295908,6.8599596928,7.2216891568,7.4951304208,7.4404728868,8.1332243958,6.2736028029,6.963685048,6.0483763169,5.8653351624,5.6164044005,6.54979166,5.8783224469,6.533468297,5.8553434082,5.7676662122,6.267915357,5.2260793903,3.745459072,6.352470342,5.4392033722,5.5562602522,5.3996670482,6.171297855,5.648779598,5.5653279855,5.671668653,5.3243595462,5.879320328,5.859442385,6.080574272,5.3767159992,6.170852717,5.3001119472,5.687201287,5.3573110752,3.586385579,5.566591422,5.5104826925,5.916268775,5.4418422465,5.4037394705,5.640889612,5.1407657702,4.5523677017,5.3873769863,3.601570449,2.978252449,4.8725960282,4.9817842222,5.2355359365,5.1227105795,5.177856607,5.098596533,5.1891181988,4.9327118245,4.4632330777,7.4879538737,4.8591269625,3.1339054377,5.8472818275,4.6043306952,3.3542942377,4.7660145915,6.6679095357,5.51150886,2.7404344677,5.9332075344,6.2019594857,5.266709364,5.4924174224,5.180577724,3.0277711677,6.2913260157,4.2862670877,5.5461328154,5.5809644644,5.1132029296,5.1904326724,4.8352505633,4.9641930171,5.1366240426,7.0699378037,3.1274712477,5.1487646306,5.2717034197,5.0200090866,3.0911490977,5.8984613527,5.1973381747,4.2427530627,6.7293864957,4.7943011637,5.1130266607,5.3948779287,4.7124246547,5.2186371577,2.9723417287,2.3171875277,2.8159853427,4.7913513947,4.7863347867,3.4531342837,3.8161332287,5.8431115757,4.4873126817,5.6577494097,5.5867970832,9.4583860946,2.7784615917,5.4279953797,1.9376872717,5.0813930177,5.8860618114,6.2411339874,6.4536904614,6.0972641874,5.7247963284,5.9823452114,5.8316140784,5.2398164977,6.2963392357,5.5864457124,6.1599995178,5.2609646384,6.1012355027,6.4129483756,6.0056487896,5.0106569884,5.4239402364,6.1148656496,2.673828844,4.3332873457,3.2943586634,4.5834393467,7.278601561,3.5870893269,3.3299191554,4.1049776549,5.9256568037,6.2719334873,6.2594329923,5.5752581689,5.6058592867,6.1311384893,6.4726413519,5.8973941434,6.2572672069,5.9667442136,5.3965422637,7.2837623985,6.9586195092,7.1137641952,6.3682104908,7.8495628418,7.2245886958,6.2983788278,7.3509762248,6.9925366658,6.5600944468,6.936328733,6.616665943,6.738732443}")<br>
CONTEXT:  PL/pgSQL function "pgr_tspdijkstra" line 8 at RETURN QUERY<br>PL/pgSQL function "pgr_tspdijkstralen" line 3 at RETURN QUERY<br>NOTICE:  r2.id1: 34304<br>CONTEXT:  PL/pgSQL function "pgr_tspdijkstra" line 8 at RETURN QUERY<br>
PL/pgSQL function "pgr_tspdijkstralen" line 3 at RETURN QUERY<br>NOTICE:  ids: <NULL><br>CONTEXT:  PL/pgSQL function "pgr_tspdijkstra" line 8 at RETURN QUERY<br>PL/pgSQL function "pgr_tspdijkstralen" line 3 at RETURN QUERY<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<br>
PL/pgSQL function "pgr_tspdijkstra" line 8 at RETURN QUERY<br>PL/pgSQL function "pgr_tspdijkstralen" line 3 at RETURN QUERY<br><br></div>I tried to write to Dose but he didn't reply yet.<br></div>Does anyone have a clue?<br>
<br>Thanks for you help<br></div>Carsten<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-20 16:24 GMT+01:00 Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 2/20/2014 9:41 AM, Stephen Woodbridge wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Carsten,<br>
<br>
The functions at<br>
   <a href="http://dose.0wnz.at/scripts/sql/pgroute_tspDijkstra.sql" target="_blank">http://dose.0wnz.at/scripts/<u></u>sql/pgroute_tspDijkstra.sql</a><br>
are not part of pgRouting.<br>
<br>
You need to ask this question to Ivan the author of the original article.<br>
</blockquote>
<br></div>
Sorry, Dose was the original author.<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
You probably need to add some debug statements to get a better<br>
understanding of what the code is doing. For example in<br>
pgr_makeDijkstraMatrix before the statement:<br>
<br>
ids := ids || array[r2.id1];<br>
</blockquote>
<br></div>
You could try changing this line to:<br>
<br>
ids := ids || r2.id1;<br>
<br>
and see if that fixes the problem.<br>
<br>
-Steve<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Add:<br>
<br>
raise notice 'r2: %', r2;<br>
raise notice 'r2.id1: %', r2.id1;<br>
raise notice 'ids: %', ids;<br>
<br>
This should show you the progression of how the array ids is getting<br>
built as it appears to be compaining about that in the error message.<br>
<br>
Hope this helps,<br>
   -Steve<br>
<br>
On 2/20/2014 9:21 AM, Carsten Hogertz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everybody, I am new to this list and new to pgrouting.<br>
<br>
I found the following TSP example<br>
<a href="http://hardwarefetish.com/513-pgrouting-dijksta-travelling-salesman-problem-tsp-with-openstreetmap" target="_blank">http://hardwarefetish.com/513-<u></u>pgrouting-dijksta-travelling-<u></u>salesman-problem-tsp-with-<u></u>openstreetmap</a><br>

<br>
and tried to reproduce the solution.<br>
<br>
Unfortunately I always get an error message.<br>
My DB is complaining about one of your functions.<br>
<br>
I got my routing table from osm2po. The table has the following<br>
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(<u></u>LineString,4326)”<br>
<br>
- I installed the functions as mentioned via SQL window in pgAdmin3<br>
(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<br>
concatenation.<br>
CONTEXT: PL/pgSQL function “pgr_makedijkstramatrix” line 25 at<br>
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<br>
concatenation.<br>
Kontext:PL/pgSQL function “pgr_makedijkstramatrix” line 25 at assignment<br>
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<br>
solutionget working. I would appreciate a lot.<br>
<br>
Thanks for your help.<br>
<br>
PS: this text is a copy of what I wrote on on the comment site of the<br>
blog where I found the solution.<br>
<br>
BR<br>
Carsten<br>
<br>
<br>
______________________________<u></u>_________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.<u></u>org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-<u></u>users</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.<u></u>org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-<u></u>users</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.<u></u>org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/pgrouting-<u></u>users</a></div></div></blockquote></div><br></div>