[pgrouting-dev] can not find the definition of the function

Hey,

I am writing the code for the new algorithm. I added the name of the file to the file “CMakeLists.txt”, and then the file can be compiled. In pgAdmin3, I can call the function shortest_path(), but when I tried to call my function shortest_path_mild_two_q(), I got the error message “no matched function”.

My question is, besides “CMakeLists.txt”, what else should I do to let the system know there is a function named shortest_path_mild_two_q().

Thanks,
Jinfu

Hi Jinfu,
It seems that your function is not created in postgres database. You need to create a .sql file and write function definition. Modify cmakelists accordingly.
If you have already done that, and didn’t work, try adding it by giving the command at sql prompt. Check out the documentation in apsp page in pgrouting wiki for exact commands.

On 14 Jun 2012 07:52, “Jinfu Leng” <logicnut@gmail.com> wrote:

Hey,

I am writing the code for the new algorithm. I added the name of the file to the file “CMakeLists.txt”, and then the file can be compiled. In pgAdmin3, I can call the function shortest_path(), but when I tried to call my function shortest_path_mild_two_q(), I got the error message “no matched function”.

My question is, besides “CMakeLists.txt”, what else should I do to let the system know there is a function named shortest_path_mild_two_q().

Thanks,
Jinfu


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

Hello Jay,

Thanks very much.

You need to create a .sql file and write function definition.
I did not know how to create the .sql file. I added the definition of the function:

CREATE OR REPLACE FUNCTION shortest_path_mild_two_q(sql text, source_id integer,
target_id integer, directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
AS ‘$libdir/librouting’
LANGUAGE ‘C’ IMMUTABLE STRICT;

to the file “rounting_core.sql”.

Modify cmakelists accordingly.
Which cmakelists.txt file are you referring to? I updated the cmakelists.txt file in the folder “core/src”.

It is not working right now.

Jinfu

On Thu, Jun 14, 2012 at 11:32 AM, Jay Mahadeokar <jai.mahadeokar@gmail.com> wrote:

Hi Jinfu,
It seems that your function is not created in postgres database. You need to create a .sql file and write function definition. Modify cmakelists accordingly.
If you have already done that, and didn’t work, try adding it by giving the command at sql prompt. Check out the documentation in apsp page in pgrouting wiki for exact commands.

On 14 Jun 2012 07:52, “Jinfu Leng” <logicnut@gmail.com> wrote:

Hey,

I am writing the code for the new algorithm. I added the name of the file to the file “CMakeLists.txt”, and then the file can be compiled. In pgAdmin3, I can call the function shortest_path(), but when I tried to call my function shortest_path_mild_two_q(), I got the error message “no matched function”.

My question is, besides “CMakeLists.txt”, what else should I do to let the system know there is a function named shortest_path_mild_two_q().

Thanks,
Jinfu


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


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

Have you looked at the “CMakeLists.txt”, which you can find in pretty much every directory?

Daniel

On Thu, Jun 14, 2012 at 1:21 PM, Jinfu Leng <logicnut@gmail.com> wrote:

Hello Jay,

Thanks very much.

You need to create a .sql file and write function definition.

I did not know how to create the .sql file. I added the definition of the function:

CREATE OR REPLACE FUNCTION shortest_path_mild_two_q(sql text, source_id integer,
target_id integer, directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
AS ‘$libdir/librouting’
LANGUAGE ‘C’ IMMUTABLE STRICT;

to the file “rounting_core.sql”.

Modify cmakelists accordingly.
Which cmakelists.txt file are you referring to? I updated the cmakelists.txt file in the folder “core/src”.

It is not working right now.

Jinfu

On Thu, Jun 14, 2012 at 11:32 AM, Jay Mahadeokar <jai.mahadeokar@gmail.com> wrote:

Hi Jinfu,
It seems that your function is not created in postgres database. You need to create a .sql file and write function definition. Modify cmakelists accordingly.
If you have already done that, and didn’t work, try adding it by giving the command at sql prompt. Check out the documentation in apsp page in pgrouting wiki for exact commands.

On 14 Jun 2012 07:52, “Jinfu Leng” <logicnut@gmail.com> wrote:

Hey,

I am writing the code for the new algorithm. I added the name of the file to the file “CMakeLists.txt”, and then the file can be compiled. In pgAdmin3, I can call the function shortest_path(), but when I tried to call my function shortest_path_mild_two_q(), I got the error message “no matched function”.

My question is, besides “CMakeLists.txt”, what else should I do to let the system know there is a function named shortest_path_mild_two_q().

Thanks,
Jinfu


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


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


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


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

Hey Daniel,

I checked every “cmakelists.txt”, and updated accordingly. In addition, I executed this
“CREATE OR REPLACE FUNCTION shortest_path_mild_two_q(sql text, source_id integer,
target_id integer, directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
AS ‘$libdir/librouting’
LANGUAGE ‘C’ IMMUTABLE STRICT;”
in pgadmin3 directly.

Right now it works.

Thanks,
Jinfu

On Thu, Jun 14, 2012 at 7:37 PM, Daniel Kastl <daniel@georepublic.de> wrote:

Have you looked at the “CMakeLists.txt”, which you can find in pretty much every directory?

Daniel

On Thu, Jun 14, 2012 at 1:21 PM, Jinfu Leng <logicnut@gmail.com> wrote:

Hello Jay,

Thanks very much.

You need to create a .sql file and write function definition.

I did not know how to create the .sql file. I added the definition of the function:

CREATE OR REPLACE FUNCTION shortest_path_mild_two_q(sql text, source_id integer,
target_id integer, directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
AS ‘$libdir/librouting’
LANGUAGE ‘C’ IMMUTABLE STRICT;

to the file “rounting_core.sql”.

Modify cmakelists accordingly.
Which cmakelists.txt file are you referring to? I updated the cmakelists.txt file in the folder “core/src”.

It is not working right now.

Jinfu

On Thu, Jun 14, 2012 at 11:32 AM, Jay Mahadeokar <jai.mahadeokar@gmail.com> wrote:

Hi Jinfu,
It seems that your function is not created in postgres database. You need to create a .sql file and write function definition. Modify cmakelists accordingly.
If you have already done that, and didn’t work, try adding it by giving the command at sql prompt. Check out the documentation in apsp page in pgrouting wiki for exact commands.

On 14 Jun 2012 07:52, “Jinfu Leng” <logicnut@gmail.com> wrote:

Hey,

I am writing the code for the new algorithm. I added the name of the file to the file “CMakeLists.txt”, and then the file can be compiled. In pgAdmin3, I can call the function shortest_path(), but when I tried to call my function shortest_path_mild_two_q(), I got the error message “no matched function”.

My question is, besides “CMakeLists.txt”, what else should I do to let the system know there is a function named shortest_path_mild_two_q().

Thanks,
Jinfu


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


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


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


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


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