GraphHopper.com | Forum | GitHub | Maps | Blog

Feeding Matrix API's response to jsprit


#1

Hi,

How do I feed my matrix api’s response data (distance and time) into Jsprit. ?

Thanks,
Karthi.


#2

Hi Kardee,
I think you are looking for this.

You can feed distance and time by:
VehicleRoutingTransportCostsMatrix.Builder costMatrixBuilder = VehicleRoutingTransportCostsMatrix.Builder.newInstance(true);

costMatrixBuilder.addTransportDistance(“idFrom”, “idTo”, distance);

costMatrixBuilder.addTransportTime(“idFrom”, “idTo”, duration);

I hope this helps.

Kind regards.


#3

FastVehicleRoutingTransportCostsMatrix might be the faster option. There is also a simple method allowing you to add time and distance at the same time.