[pgrouting-users] pgr_withPointsDD - arguments

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[pgrouting-users] pgr_withPointsDD - arguments

Jakob Miksch
Dear List,

I compare the arguments of "pgr_drivingDistance"[1] and
"pgr_withPointsDD"[2].

The example of "pgr_withPointsDD"[2] confuses me. In the examples the
argument "edges_sql" ends with "ORDER BY id". Whereas
"pgr_drivingDistance"[1] does not.

Is there any reason for the "ORDER BY id" in the "pgr_withPointsDD"[2]
function?
(see examples below)

Best regards,
Jakob

[1] http://docs.pgrouting.org/latest/en/pgr_drivingDistance.html
[2] http://docs.pgrouting.org/latest/en/pgr_withPointsDD.html

Examples:

SELECT * FROM pgr_drivingDistance(
         'SELECT id, source, target, cost, reverse_cost FROM edge_table',
         2, 3
       );


SELECT * FROM pgr_withPointsDD(
     'SELECT id, source, target, cost, reverse_cost FROM edge_table
ORDER BY id',
     'SELECT pid, edge_id, fraction, side from pointsOfInterest',
     -1, 3.8,
     driving_side := 'l',
     details := true);
_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users
Reply | Threaded
Open this post in threaded view
|

Re: [pgrouting-users] pgr_withPointsDD - arguments

Vicky Vergara-2
Hello,

Yes, there is a reason, all the edges have the same cost in the sample graph, so there might be more than one path from one vertex to another with the same min cost.
To get the same result on this examples ORDER BY keeps  always the input in the same order, so it will give the results in the same order.

All the documentation queries/results are generated automatically, but different OS can give different results because the internal storage, we test those queries on three different OS, and sometimes without the ORDER BY, form one to another the results are different.

going from v5 to v11 can be done as follows
(Possible answer on OS foo)
v5 -> v10 -> v11 with cost 2
or as follows
(Possible answer on OS bar)
v5 -> v6 -> v11 with cost 2

Vicky













On Sat, Sep 30, 2017 at 6:27 AM, Jakob Miksch <[hidden email]> wrote:
Dear List,

I compare the arguments of "pgr_drivingDistance"[1] and "pgr_withPointsDD"[2].

The example of "pgr_withPointsDD"[2] confuses me. In the examples the argument "edges_sql" ends with "ORDER BY id". Whereas "pgr_drivingDistance"[1] does not.

Is there any reason for the "ORDER BY id" in the "pgr_withPointsDD"[2] function?
(see examples below)

Best regards,
Jakob

[1] http://docs.pgrouting.org/latest/en/pgr_drivingDistance.html
[2] http://docs.pgrouting.org/latest/en/pgr_withPointsDD.html

Examples:

SELECT * FROM pgr_drivingDistance(
        'SELECT id, source, target, cost, reverse_cost FROM edge_table',
        2, 3
      );


SELECT * FROM pgr_withPointsDD(
    'SELECT id, source, target, cost, reverse_cost FROM edge_table ORDER BY id',
    'SELECT pid, edge_id, fraction, side from pointsOfInterest',
    -1, 3.8,
    driving_side := 'l',
    details := true);
_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://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
Web: 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


_______________________________________________
Pgrouting-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pgrouting-users