[pgrouting-users] Many errors : function driving_distance does not exist, shortest_path_astar , tps

Hello Danniel. Thanks again for your support. I progress but i have so much to learn.

why this error for this 3 request ?

SELECT * from driving_distance(‘select gid as id,source,target,length::double precision as cost from ways’,22777838,0.01);

ERROR: function driving_distance (“unknown”, integer, numeric) does not exist
HINT: No function matches the given name and argument types. You need to add explicit type conversions.

SELECT * FROM shortest_path_astar(‘select gid as id,source::int4,target::int4,reverse_cost::double precision as reverse_cost,x1,y1,x2,y2 from ways’,22,150,false,false);
ERREUR: Error, query must return columns ‘id’, ‘source’, ‘target’ and ‘cost’

SELECT * from tsp(‘select distinct source as source_id,x1::double precision as x,y1::double precision as y from ways where source in(91,35,75,504,254)’,‘91,35,75,504,254’,353);

WARNING: stop the connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to cancel the transaction
Current and leave because another process server left abnormally
and there is probably corrupted shared memory.
TIP: In a moment you should be able to reconnect to the base of
data and restart your order.
the server connection was cut off unexpectedly
The server may have terminated abnormally before or during
processing the request.
The server connection was lost. Attempting reset: success / or sometimes not.

I don’t understand why all thes errors becose shortest_path function run correctly. Exple

SELECT * FROM shortest_path(‘SELECT gid as id,source::integer,target::integer,length::double precision as cost FROM ways’,300,400, false, false); give to me :

vertex_id | edge_id | cost
-----------±--------±-------------------
300 | 339 | 0.139255214687805
299 | 338 | 0.179544765048058
195 | 337 | 0.203993410356029
63 | 56 | 0.163071365291157
64 | 57 | 0.0210195901922476
13 | 592 | 0.154135925931186
353 | 593 | 0.167432867084967
255 | 594 | 0.0922310799956524
111 | 595 | 0.410249680272814
435 | 596 | 0.323252439058039
400 | -1 | 0
(11 lignes)

My table “ways” is join.

Thanks !

dump.sql (368 KB)

Hi Jules,

I can’t manage to import your dump file. It only contains data, but not the “ways”.
This is how the “ways” table looks in the pgRouting workshop:

CREATE TABLE ways (
gid integer NOT NULL,
class_id integer,
length double precision,
“name” character(200),
x1 double precision,
y1 double precision,
x2 double precision,
y2 double precision,
reverse_cost double precision,
“rule” text,
to_cost double precision,
the_geom geometry,
source integer,
target integer,
CONSTRAINT ways_pkey PRIMARY KEY (gid),
CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = ‘MULTILINESTRING’::text OR the_geom IS NULL),
CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 4326)
) WITH (
OIDS=FALSE
);

SELECT * from driving_distance('select gid as id,source,target,length::double precision as cost from ways’,22777838,0.01);

ERROR: function driving_distance (“unknown”, integer, numeric) does not exist
HINT: No function matches the given name and argument types. You need to add explicit type conversions.

There are two functions with this name that take different arguments:
https://github.com/pgRouting/pgrouting/blob/master/extra/driving_distance/sql/routing_dd_wrappers.sql#L78
https://github.com/pgRouting/pgrouting/blob/master/extra/driving_distance/sql/routing_dd.sql#L24

SELECT * FROM shortest_path_astar(‘select gid as id,source::int4,target::int4,reverse_cost::double precision as reverse_cost,x1,y1,x2,y2 from ways’,22,150,false,false);
ERREUR: Error, query must return columns ‘id’, ‘source’, ‘target’ and ‘cost’

There could be something wrong with your “ways” table, because I couldn’t load the table dump either.

SELECT * from tsp(‘select distinct source as source_id,x1::double precision as x,y1::double precision as y from ways where source in(91,35,75,504,254)’,‘91,35,75,504,254’,353);

WARNING: stop the connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to cancel the transaction
Current and leave because another process server left abnormally
and there is probably corrupted shared memory.
TIP: In a moment you should be able to reconnect to the base of
data and restart your order.
the server connection was cut off unexpectedly
The server may have terminated abnormally before or during
processing the request.
The server connection was lost. Attempting reset: success / or sometimes not.

Have you tried one of the TSP wrapper functions?
https://github.com/pgRouting/pgrouting/blob/master/extra/tsp/sql/routing_tsp_wrappers.sql

They take less arguments, so maybe easier to make the query correct.

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

This is all my databse (routing).
Please look at this.

2011/8/22 Jules Kouadio <sekedoua@gmail.com>

Hello Danniel. Thanks again for your support. I progress but i have so much to learn.

why this error for this 3 request ?

SELECT * from driving_distance(‘select gid as id,source,target,length::double precision as cost from ways’,22777838,0.01);

ERROR: function driving_distance (“unknown”, integer, numeric) does not exist
HINT: No function matches the given name and argument types. You need to add explicit type conversions.

SELECT * FROM shortest_path_astar(‘select gid as id,source::int4,target::int4,reverse_cost::double precision as reverse_cost,x1,y1,x2,y2 from ways’,22,150,false,false);
ERREUR: Error, query must return columns ‘id’, ‘source’, ‘target’ and ‘cost’

SELECT * from tsp(‘select distinct source as source_id,x1::double precision as x,y1::double precision as y from ways where source in(91,35,75,504,254)’,‘91,35,75,504,254’,353);

WARNING: stop the connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to cancel the transaction
Current and leave because another process server left abnormally
and there is probably corrupted shared memory.
TIP: In a moment you should be able to reconnect to the base of
data and restart your order.
the server connection was cut off unexpectedly
The server may have terminated abnormally before or during
processing the request.
The server connection was lost. Attempting reset: success / or sometimes not.

I don’t understand why all thes errors becose shortest_path function run correctly. Exple

SELECT * FROM shortest_path(‘SELECT gid as id,source::integer,target::integer,length::double precision as cost FROM ways’,300,400, false, false); give to me :

vertex_id | edge_id | cost
-----------±--------±-------------------
300 | 339 | 0.139255214687805
299 | 338 | 0.179544765048058
195 | 337 | 0.203993410356029
63 | 56 | 0.163071365291157
64 | 57 | 0.0210195901922476
13 | 592 | 0.154135925931186
353 | 593 | 0.167432867084967
255 | 594 | 0.0922310799956524
111 | 595 | 0.410249680272814
435 | 596 | 0.323252439058039
400 | -1 | 0
(11 lignes)

My table “ways” is join.

Thanks !


dump.sql.gz (289 KB)

Hi Jules,

Here are working examples of your queries:

SELECT * FROM shortest_path_astar(
‘SELECT gid AS id,source::integer,target::integer,length::double precision AS cost,x1,y1,x2,y2 FROM ways’,
300,400,false,false
);

SELECT * FROM driving_distance(
‘SELECT gid AS id,source,target,length::double precision AS cost FROM ways’,
300,1.0,false,false
);

SELECT * FROM tsp(
‘SELECT DISTINCT source AS source_id,x1::double precision as x,y1::double precision AS y FROM ways WHERE source IN(91,35,75,504,254)’,
‘91,35,75,504,254’,75
);

Best regards,
Daniel

On Tue, Aug 23, 2011 at 12:08 AM, Jules Kouadio <sekedoua@gmail.com> wrote:

This is all my databse (routing).
Please look at this.

2011/8/22 Jules Kouadio <sekedoua@gmail.com>

Hello Danniel. Thanks again for your support. I progress but i have so much to learn.

why this error for this 3 request ?

SELECT * from driving_distance(‘select gid as id,source,target,length::double precision as cost from ways’,22777838,0.01);

ERROR: function driving_distance (“unknown”, integer, numeric) does not exist
HINT: No function matches the given name and argument types. You need to add explicit type conversions.

SELECT * FROM shortest_path_astar(‘select gid as id,source::int4,target::int4,reverse_cost::double precision as reverse_cost,x1,y1,x2,y2 from ways’,22,150,false,false);
ERREUR: Error, query must return columns ‘id’, ‘source’, ‘target’ and ‘cost’

SELECT * from tsp(‘select distinct source as source_id,x1::double precision as x,y1::double precision as y from ways where source in(91,35,75,504,254)’,‘91,35,75,504,254’,353);

WARNING: stop the connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to cancel the transaction
Current and leave because another process server left abnormally
and there is probably corrupted shared memory.
TIP: In a moment you should be able to reconnect to the base of
data and restart your order.
the server connection was cut off unexpectedly
The server may have terminated abnormally before or during
processing the request.
The server connection was lost. Attempting reset: success / or sometimes not.

I don’t understand why all thes errors becose shortest_path function run correctly. Exple

SELECT * FROM shortest_path(‘SELECT gid as id,source::integer,target::integer,length::double precision as cost FROM ways’,300,400, false, false); give to me :

vertex_id | edge_id | cost
-----------±--------±-------------------
300 | 339 | 0.139255214687805
299 | 338 | 0.179544765048058
195 | 337 | 0.203993410356029
63 | 56 | 0.163071365291157
64 | 57 | 0.0210195901922476
13 | 592 | 0.154135925931186
353 | 593 | 0.167432867084967
255 | 594 | 0.0922310799956524
111 | 595 | 0.410249680272814
435 | 596 | 0.323252439058039
400 | -1 | 0
(11 lignes)

My table “ways” is join.

Thanks !


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

Thank you so mutch ! All is running !
I see that my request was not correctly wrotte .
How can i now visualyse all this result on a map (on a web map server).
Do you have a good tutorial, step by step, whith all details ?

Thanks again

2011/8/22 Daniel Kastl <daniel@georepublic.de>

Hi Jules,

Here are working examples of your queries:

SELECT * FROM shortest_path_astar(

‘SELECT gid AS id,source::integer,target::integer,length::double precision AS cost,x1,y1,x2,y2 FROM ways’,
300,400,false,false
);

SELECT * FROM driving_distance(
‘SELECT gid AS id,source,target,length::double precision AS cost FROM ways’,
300,1.0,false,false
);

SELECT * FROM tsp(
‘SELECT DISTINCT source AS source_id,x1::double precision as x,y1::double precision AS y FROM ways WHERE source IN(91,35,75,504,254)’,
‘91,35,75,504,254’,75
);

Best regards,
Daniel

On Tue, Aug 23, 2011 at 12:08 AM, Jules Kouadio <sekedoua@gmail.com> wrote:

This is all my databse (routing).
Please look at this.

2011/8/22 Jules Kouadio <sekedoua@gmail.com>

Hello Danniel. Thanks again for your support. I progress but i have so much to learn.

why this error for this 3 request ?

SELECT * from driving_distance(‘select gid as id,source,target,length::double precision as cost from ways’,22777838,0.01);

ERROR: function driving_distance (“unknown”, integer, numeric) does not exist
HINT: No function matches the given name and argument types. You need to add explicit type conversions.

SELECT * FROM shortest_path_astar(‘select gid as id,source::int4,target::int4,reverse_cost::double precision as reverse_cost,x1,y1,x2,y2 from ways’,22,150,false,false);
ERREUR: Error, query must return columns ‘id’, ‘source’, ‘target’ and ‘cost’

SELECT * from tsp(‘select distinct source as source_id,x1::double precision as x,y1::double precision as y from ways where source in(91,35,75,504,254)’,‘91,35,75,504,254’,353);

WARNING: stop the connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to cancel the transaction
Current and leave because another process server left abnormally
and there is probably corrupted shared memory.
TIP: In a moment you should be able to reconnect to the base of
data and restart your order.
the server connection was cut off unexpectedly
The server may have terminated abnormally before or during
processing the request.
The server connection was lost. Attempting reset: success / or sometimes not.

I don’t understand why all thes errors becose shortest_path function run correctly. Exple

SELECT * FROM shortest_path(‘SELECT gid as id,source::integer,target::integer,length::double precision as cost FROM ways’,300,400, false, false); give to me :

vertex_id | edge_id | cost
-----------±--------±-------------------
300 | 339 | 0.139255214687805
299 | 338 | 0.179544765048058
195 | 337 | 0.203993410356029
63 | 56 | 0.163071365291157
64 | 57 | 0.0210195901922476
13 | 592 | 0.154135925931186
353 | 593 | 0.167432867084967
255 | 594 | 0.0922310799956524
111 | 595 | 0.410249680272814
435 | 596 | 0.323252439058039
400 | -1 | 0
(11 lignes)

My table “ways” is join.

Thanks !


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


If you want to write some web application, then you can use OpenLayers/GeoExt for example.
See the pgRouting workshop: http://workshop.pgrouting.org/ (there will be an updated on released with FOSS4G in September).
Instead of PHP (or some other server side coding) you can also use Geoserver “SQL views”: http://docs.geoserver.org/stable/en/user/data/sqlview.html
It’s a new feature of Geoserver andvery convenient.

If you only want to check results you can use QGIS:

  • Create a database connection and add the “ways” table as a background layer.
  • Add another layer of the “ways” table but select Build query before adding it.
  • Type for example “gid” IN ( SELECT gid FROM dijkstra_sp(‘ways’,5700,6733)) into the SQL where clause field.
    Hope that helps.

Daniel

On Tue, Aug 23, 2011 at 1:01 AM, Jules Kouadio <sekedoua@gmail.com> wrote:

Thank you so mutch ! All is running !
I see that my request was not correctly wrotte .
How can i now visualyse all this result on a map (on a web map server).
Do you have a good tutorial, step by step, whith all details ?

Thanks again

2011/8/22 Daniel Kastl <daniel@georepublic.de>

Hi Jules,

Here are working examples of your queries:

SELECT * FROM shortest_path_astar(

‘SELECT gid AS id,source::integer,target::integer,length::double precision AS cost,x1,y1,x2,y2 FROM ways’,
300,400,false,false
);

SELECT * FROM driving_distance(
‘SELECT gid AS id,source,target,length::double precision AS cost FROM ways’,
300,1.0,false,false
);

SELECT * FROM tsp(
‘SELECT DISTINCT source AS source_id,x1::double precision as x,y1::double precision AS y FROM ways WHERE source IN(91,35,75,504,254)’,
‘91,35,75,504,254’,75
);

Best regards,
Daniel

On Tue, Aug 23, 2011 at 12:08 AM, Jules Kouadio <sekedoua@gmail.com> wrote:

This is all my databse (routing).
Please look at this.

2011/8/22 Jules Kouadio <sekedoua@gmail.com>

Hello Danniel. Thanks again for your support. I progress but i have so much to learn.

why this error for this 3 request ?

SELECT * from driving_distance(‘select gid as id,source,target,length::double precision as cost from ways’,22777838,0.01);

ERROR: function driving_distance (“unknown”, integer, numeric) does not exist
HINT: No function matches the given name and argument types. You need to add explicit type conversions.

SELECT * FROM shortest_path_astar(‘select gid as id,source::int4,target::int4,reverse_cost::double precision as reverse_cost,x1,y1,x2,y2 from ways’,22,150,false,false);
ERREUR: Error, query must return columns ‘id’, ‘source’, ‘target’ and ‘cost’

SELECT * from tsp(‘select distinct source as source_id,x1::double precision as x,y1::double precision as y from ways where source in(91,35,75,504,254)’,‘91,35,75,504,254’,353);

WARNING: stop the connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to cancel the transaction
Current and leave because another process server left abnormally
and there is probably corrupted shared memory.
TIP: In a moment you should be able to reconnect to the base of
data and restart your order.
the server connection was cut off unexpectedly
The server may have terminated abnormally before or during
processing the request.
The server connection was lost. Attempting reset: success / or sometimes not.

I don’t understand why all thes errors becose shortest_path function run correctly. Exple

SELECT * FROM shortest_path(‘SELECT gid as id,source::integer,target::integer,length::double precision as cost FROM ways’,300,400, false, false); give to me :

vertex_id | edge_id | cost
-----------±--------±-------------------
300 | 339 | 0.139255214687805
299 | 338 | 0.179544765048058
195 | 337 | 0.203993410356029
63 | 56 | 0.163071365291157
64 | 57 | 0.0210195901922476
13 | 592 | 0.154135925931186
353 | 593 | 0.167432867084967
255 | 594 | 0.0922310799956524
111 | 595 | 0.410249680272814
435 | 596 | 0.323252439058039
400 | -1 | 0
(11 lignes)

My table “ways” is join.

Thanks !


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

Hi Jules,

Any argument against using the latest workshop?
The one you try is 4 years old now and uses a very old version of OpenLayers. I should remove it from the website actually.

Daniel

On Wed, Aug 24, 2011 at 9:25 PM, Jules Kouadio <sekedoua@gmail.com> wrote:

Hi Daniel.
For my table “ways” i follow step by step this tutorial :
http://www.pgrouting.org/docs/foss4g2007/ch03.html

but i dont see any map on my web page 06.indexhtml
Can you please help me and tell me why i have this problem ?

Thanks .

2011/8/22 Daniel Kastl <daniel@georepublic.de>

If you want to write some web application, then you can use OpenLayers/GeoExt for example.
See the pgRouting workshop: http://workshop.pgrouting.org/ (there will be an updated on released with FOSS4G in September).
Instead of PHP (or some other server side coding) you can also use Geoserver “SQL views”: http://docs.geoserver.org/stable/en/user/data/sqlview.html
It’s a new feature of Geoserver andvery convenient.

If you only want to check results you can use QGIS:

  • Create a database connection and add the “ways” table as a background layer.
  • Add another layer of the “ways” table but select Build query before adding it.
  • Type for example “gid” IN ( SELECT gid FROM dijkstra_sp(‘ways’,5700,6733)) into the SQL where clause field.
    Hope that helps.

Daniel

On Tue, Aug 23, 2011 at 1:01 AM, Jules Kouadio <sekedoua@gmail.com> wrote:

Thank you so mutch ! All is running !
I see that my request was not correctly wrotte .
How can i now visualyse all this result on a map (on a web map server).
Do you have a good tutorial, step by step, whith all details ?

Thanks again

2011/8/22 Daniel Kastl <daniel@georepublic.de>

Hi Jules,

Here are working examples of your queries:

SELECT * FROM shortest_path_astar(

‘SELECT gid AS id,source::integer,target::integer,length::double precision AS cost,x1,y1,x2,y2 FROM ways’,
300,400,false,false
);

SELECT * FROM driving_distance(
‘SELECT gid AS id,source,target,length::double precision AS cost FROM ways’,
300,1.0,false,false
);

SELECT * FROM tsp(
‘SELECT DISTINCT source AS source_id,x1::double precision as x,y1::double precision AS y FROM ways WHERE source IN(91,35,75,504,254)’,
‘91,35,75,504,254’,75
);

Best regards,
Daniel

On Tue, Aug 23, 2011 at 12:08 AM, Jules Kouadio <sekedoua@gmail.com> wrote:

This is all my databse (routing).
Please look at this.

2011/8/22 Jules Kouadio <sekedoua@gmail.com>

Hello Danniel. Thanks again for your support. I progress but i have so much to learn.

why this error for this 3 request ?

SELECT * from driving_distance(‘select gid as id,source,target,length::double precision as cost from ways’,22777838,0.01);

ERROR: function driving_distance (“unknown”, integer, numeric) does not exist
HINT: No function matches the given name and argument types. You need to add explicit type conversions.

SELECT * FROM shortest_path_astar(‘select gid as id,source::int4,target::int4,reverse_cost::double precision as reverse_cost,x1,y1,x2,y2 from ways’,22,150,false,false);
ERREUR: Error, query must return columns ‘id’, ‘source’, ‘target’ and ‘cost’

SELECT * from tsp(‘select distinct source as source_id,x1::double precision as x,y1::double precision as y from ways where source in(91,35,75,504,254)’,‘91,35,75,504,254’,353);

WARNING: stop the connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to cancel the transaction
Current and leave because another process server left abnormally
and there is probably corrupted shared memory.
TIP: In a moment you should be able to reconnect to the base of
data and restart your order.
the server connection was cut off unexpectedly
The server may have terminated abnormally before or during
processing the request.
The server connection was lost. Attempting reset: success / or sometimes not.

I don’t understand why all thes errors becose shortest_path function run correctly. Exple

SELECT * FROM shortest_path(‘SELECT gid as id,source::integer,target::integer,length::double precision as cost FROM ways’,300,400, false, false); give to me :

vertex_id | edge_id | cost
-----------±--------±-------------------
300 | 339 | 0.139255214687805
299 | 338 | 0.179544765048058
195 | 337 | 0.203993410356029
63 | 56 | 0.163071365291157
64 | 57 | 0.0210195901922476
13 | 592 | 0.154135925931186
353 | 593 | 0.167432867084967
255 | 594 | 0.0922310799956524
111 | 595 | 0.410249680272814
435 | 596 | 0.323252439058039
400 | -1 | 0
(11 lignes)

My table “ways” is join.

Thanks !


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de