[pgrouting-users] About Darp Brach and openvrp

guigra guigra guigra at gmail.com
Thu Dec 8 10:47:24 EST 2011


Hello

I compile and running pgrouting darp branch on my ubuntu linux. I download
Openvrp demos too.

I have some problems integrating openvrp and darp functions.

I have problems with some  params:  depot_id, depot_position_id and penalty
query for darp function. I don´t understand depot_position_id .

Can send me some samples to integrate openvrp and darp branch?

darp function signature:

CREATE OR REPLACE FUNCTION darp(orders_sql text, vehicles_sql text,
distance_sql text, depot_id integer, depot_point_id integer,
penalties_sql text)


        RETURNS SETOF itinerary
        AS '$libdir/librouting_darp'
        LANGUAGE 'C' IMMUTABLE STRICT;

openvrp call to darp function on  darp.php file:

 function calculate()
        {
                $data = array(
                        'depot_id' => $this->input->post('depot_id')
,
                        'nearest'  => $this->input->post('nearest'),



                        'method'   => $this->input->post('method')
                );

                $sql = "SELECT b.*, a.id, a.order_id,
vehicle_id,pick_up, to_char(at, 'YYYY-MM-DD HH24:MI:SS'::text) AS at



                                        FROM darp(
                                                'SELECT * FROM
darp_orders WHERE depot_id IN (0,".$data['depot_id'].")',
                                                'SELECT * FROM
darp_vehicles WHERE depot_id = ".$data['depot_id']."',



                                                '".$distance =
$this->_getdistances($data)."',

                                        ) a LEFT JOIN (SELECT * FROM
darp_report WHERE depot_id IN (0,".$data['depot_id'].")) AS b ON
(a.order_id = b.id);";


                $query = $this->db->query($sql);
                $this->output->set_output($this->_encode($query));
            }



Thank's in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20111208/668b5061/attachment.html


More information about the Pgrouting-users mailing list