[pgrouting-users] pgr_withPoints not working correctly

Hi, I’ve tried this function and it seems not to work correctly. When it calculates the route between vertex it does well, but when using the pointsofinterest, it confuses the ids of the points and the result is incorrect.

If we take a look at the example:

image002.png

···


Example:



From point 1 to point 3

SELECT * FROM pgr_withPoints(

‘SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id’,

‘SELECT pid, edge_id, fraction, side from pointsOfInterest’,

-1, -3);

seq | path_seq | node | edge | cost | agg_cost

-----±---------±-----±-----±-----±---------

1 | 1 | -1 | 1 | 0.6 | 0

2 | 2 | 2 | 4 | 1 | 0.6

3 | 3 | 5 | 7 | 1 | 1.6

4 | 4 | 8 | 6 | 0.7 | 2.6

5 | 5 | -3 | -1 | 0 | 3.3

(5 rows)

If we follow the edges, we’ll see that it begins from the point 1 but ends at point 4. Edges sequence(1,4,7,6)

../../../_images/Fig1-originalData.png

These are the correspondences of the points

Point of ‘Pointsofinterest’ Point used by pgr_withpoints

1 1

2 5

3 4

4 2

5 3

6 6

Hope I explained myself clearly, and sorry for my English (;P).

Josep.


CONFIDENCIALITAT
Aquesta informació és confidencial, personal i intransferible i només va dirigida a la/les adreça/ces indicades. Qualsevol modificació, retransmissió, difusió o altre ús d’aquesta informació per persones o entitats diferents a la persona a qui va dirigida està prohibida. Si vostè l’ha rebut per error, li preguem que ho reenviï a desconegut@tecnocampus.cat, i esborri el missatge original juntament amb els seus fitxers annexos sense llegir-lo ni gravar-lo. Gràcies.
Abans d’imprimir-lo, assegura’t de que és realment necessari.
EL MEDI AMBIENT ÉS COSA DE TOTS.

CONFIDENCIALIDAD
La presente información es confidencial, personal e intransferible y sólo va dirigida a la/s dirección/es indicadas. Cualquier modificación, retransmisión, difusión u otro uso de esta información por personas o entidades diferentes a la persona a la que va dirigida está prohibida. Si usted lo ha recibido por error, le rogamos que lo reenvie a desconegut@tecnocampus.com, y borre el mensaje original junto con sus ficheros anexos sin leerlo ni grabarlo. Gracias.
Antes de imprimir, asegúrese que es realmente necesario hacerlo.
EL MEDIO AMBIENTE ES COSA DE TODOS.

Josep:
Your explanation is very clear, thanks for testing.

Please open an issue with this bug. (while I start working on it)
https://github.com/pgRouting/pgrouting/issues

Just for your information: one of the reasons that the new functionality is placed as proposed functions because of bugs that might still be there.

Thanks again for trying it out.

Vicky

···

On Thu, Apr 14, 2016 at 1:03 PM, Josep Lopez Xarbau <jlopez@tecnocampus.cat> wrote:

Hi, I’ve tried this function and it seems not to work correctly. When it calculates the route between vertex it does well, but when using the pointsofinterest, it confuses the ids of the points and the result is incorrect.

If we take a look at the example:



Example:



>From point 1 to point 3

SELECT * FROM pgr_withPoints(

‘SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id’,

‘SELECT pid, edge_id, fraction, side from pointsOfInterest’,

-1, -3);

seq | path_seq | node | edge | cost | agg_cost

-----±---------±-----±-----±-----±---------

1 | 1 | -1 | 1 | 0.6 | 0

2 | 2 | 2 | 4 | 1 | 0.6

3 | 3 | 5 | 7 | 1 | 1.6

4 | 4 | 8 | 6 | 0.7 | 2.6

5 | 5 | -3 | -1 | 0 | 3.3

(5 rows)

If we follow the edges, we’ll see that it begins from the point 1 but ends at point 4. Edges sequence(1,4,7,6)

../../../_images/Fig1-originalData.png

These are the correspondences of the points

Point of ‘Pointsofinterest’ Point used by pgr_withpoints

1 1

2 5

3 4

4 2

5 3

6 6

Hope I explained myself clearly, and sorry for my English (;P).

Josep.


CONFIDENCIALITAT
Aquesta informació és confidencial, personal i intransferible i només va dirigida a la/les adreça/ces indicades. Qualsevol modificació, retransmissió, difusió o altre ús d’aquesta informació per persones o entitats diferents a la persona a qui va dirigida està prohibida. Si vostè l’ha rebut per error, li preguem que ho reenviï a desconegut@tecnocampus.cat, i esborri el missatge original juntament amb els seus fitxers annexos sense llegir-lo ni gravar-lo. Gràcies.
Abans d’imprimir-lo, assegura’t de que és realment necessari.
EL MEDI AMBIENT ÉS COSA DE TOTS.

CONFIDENCIALIDAD
La presente información es confidencial, personal e intransferible y sólo va dirigida a la/s dirección/es indicadas. Cualquier modificación, retransmisión, difusión u otro uso de esta información por personas o entidades diferentes a la persona a la que va dirigida está prohibida. Si usted lo ha recibido por error, le rogamos que lo reenvie a desconegut@tecnocampus.com, y borre el mensaje original junto con sus ficheros anexos sin leerlo ni grabarlo. Gracias.
Antes de imprimir, asegúrese que es realmente necesario hacerlo.
EL MEDIO AMBIENTE ES COSA DE TODOS.


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

Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@[georepublic.de](http://georepublic.de)
Web: [https://georepublic.info](https://georepublic.info)

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl

Josep:

This is what is expected:

SELECT * FROM pgr_withPoints(
‘SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id’,
‘SELECT pid, edge_id, fraction, side from pointsOfInterest’,
-1, -3);
seq | path_seq | node | edge | cost | agg_cost

···

On Fri, Apr 15, 2016 at 12:43 AM, Vicky Vergara <vicky@georepublic.de> wrote:

Josep:
Your explanation is very clear, thanks for testing.

Please open an issue with this bug. (while I start working on it)
https://github.com/pgRouting/pgrouting/issues

Just for your information: one of the reasons that the new functionality is placed as proposed functions because of bugs that might still be there.

Thanks again for trying it out.

Vicky

On Thu, Apr 14, 2016 at 1:03 PM, Josep Lopez Xarbau <jlopez@tecnocampus.cat> wrote:

Hi, I’ve tried this function and it seems not to work correctly. When it calculates the route between vertex it does well, but when using the pointsofinterest, it confuses the ids of the points and the result is incorrect.

If we take a look at the example:



Example:



>From point 1 to point 3

SELECT * FROM pgr_withPoints(

‘SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id’,

‘SELECT pid, edge_id, fraction, side from pointsOfInterest’,

-1, -3);

seq | path_seq | node | edge | cost | agg_cost

-----±---------±-----±-----±-----±---------

1 | 1 | -1 | 1 | 0.6 | 0

2 | 2 | 2 | 4 | 1 | 0.6

3 | 3 | 5 | 7 | 1 | 1.6

4 | 4 | 8 | 6 | 0.7 | 2.6

5 | 5 | -3 | -1 | 0 | 3.3

(5 rows)

If we follow the edges, we’ll see that it begins from the point 1 but ends at point 4. Edges sequence(1,4,7,6)

../../../_images/Fig1-originalData.png

These are the correspondences of the points

Point of ‘Pointsofinterest’ Point used by pgr_withpoints

1 1

2 5

3 4

4 2

5 3

6 6

Hope I explained myself clearly, and sorry for my English (;P).

Josep.


CONFIDENCIALITAT
Aquesta informació és confidencial, personal i intransferible i només va dirigida a la/les adreça/ces indicades. Qualsevol modificació, retransmissió, difusió o altre ús d’aquesta informació per persones o entitats diferents a la persona a qui va dirigida està prohibida. Si vostè l’ha rebut per error, li preguem que ho reenviï a desconegut@tecnocampus.cat, i esborri el missatge original juntament amb els seus fitxers annexos sense llegir-lo ni gravar-lo. Gràcies.
Abans d’imprimir-lo, assegura’t de que és realment necessari.
EL MEDI AMBIENT ÉS COSA DE TOTS.

CONFIDENCIALIDAD
La presente información es confidencial, personal e intransferible y sólo va dirigida a la/s dirección/es indicadas. Cualquier modificación, retransmisión, difusión u otro uso de esta información por personas o entidades diferentes a la persona a la que va dirigida está prohibida. Si usted lo ha recibido por error, le rogamos que lo reenvie a desconegut@tecnocampus.com, y borre el mensaje original junto con sus ficheros anexos sin leerlo ni grabarlo. Gracias.
Antes de imprimir, asegúrese que es realmente necesario hacerlo.
EL MEDIO AMBIENTE ES COSA DE TODOS.


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

Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@[georepublic.de](http://georepublic.de)
Web: [https://georepublic.info](https://georepublic.info)

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl

Georepublic UG (haftungsbeschränkt)
Salzmannstraße 44, 
81739 München, Germany

Vicky Vergara
Operations Research

eMail: vicky@[georepublic.de](http://georepublic.de)
Web: [https://georepublic.info](https://georepublic.info)

Tel: +49 (089) 4161 7698-1
Fax: +49 (089) 4161 7698-9

Commercial register: Amtsgericht München, HRB 181428
CEO: Daniel Kastl