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

Carsten Hogertz carsten.hogertz at gmail.com
Thu Feb 20 07:27:17 PST 2014


Hi Steve,
thanks for your suggestion. I'll try that later when back from office.
BR
Carsten


2014-02-20 15:41 GMT+01:00 Stephen Woodbridge <woodbri at swoodbridge.com>:

> Hi Carsten,
>
> The functions at
>   http://dose.0wnz.at/scripts/sql/pgroute_tspDijkstra.sql
> are not part of pgRouting.
>
> You need to ask this question to Ivan the author of the original article.
>
> You probably need to add some debug statements to get a better
> understanding of what the code is doing. For example in
> pgr_makeDijkstraMatrix before the statement:
>
> ids := ids || array[r2.id1];
>
> Add:
>
> raise notice 'r2: %', r2;
> raise notice 'r2.id1: %', r2.id1;
> raise notice 'ids: %', ids;
>
> This should show you the progression of how the array ids is getting built
> as it appears to be compaining about that in the error message.
>
> Hope this helps,
>   -Steve
>
>
> On 2/20/2014 9:21 AM, Carsten Hogertz wrote:
>
>> 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
>>
>>
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
>>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20140220/2a9ddb90/attachment.html>


More information about the Pgrouting-users mailing list