[pgrouting-dev] About Darp Brach and openvrp
guigra guigra
guigra at gmail.com
Mon Dec 5 05:39:16 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-dev/attachments/20111205/3d2911c4/attachment.html
More information about the pgrouting-dev
mailing list