Road transfer inference
At Lune, we aim to make emissions calculations as simple and accurate as possible. That’s why we offer Road transfer inference, a feature that helps refine journey details when limited data is available.By analysing the source and destination locations you provide, Lune can determine whether route corrections or additional legs should be added. Inference improves the accuracy of emissions calculations, even with minimal input data.Pre-requisites
Complete the following setup steps before using this guide:
Generate an API key and authenticate your account.

Set up Client Accounts to track emissions for your individual customers.

Review how to calculate emissions for multi-leg shipments using the API.
How it works
To engage road transfer inference in your emission estimate calculation, the following steps must be taken. When making an API request for a shipment emission estimate, you must include the source and destination for your shipment. Additionally, include aapply_route_inference
query parameter to your endpoint and set it to true
.Lune will assess the locations, and determine if adjustments need to be made based on the distance from a sea port, airport, or rail station, and the transport method chosen.Depending on the input data, inference will work in one of two ways:- Additional legs will be added
- The source and destination will be adjusted to a nearby port
1. Additional leg inference
If the source or destination location is far from an airport, seaport, or rail station, but the transport method is set to air, sea, or rail respectively, it is likely that the shipment was transported to or from the port by road. Therefore, when making the emission estimate, Lune will add a road leg to the overall shipment to represent this transport.This leg will take the shipment to or from the indicated source or destination location, to the closest port for the chosen transport method. If a road leg has already been included in the shipment, the additional leg will use the same vehicle details as the adjacent road leg. Otherwise, the leg emission estimate will be calculated based on the use of a generic diesel truck.2. Port inference
If the starting location is pretty close but not exactly the location of an airport, seaport, or rail station, and the shipment is by air, sea, or rail respectively, Lune will automatically adjust the location to the nearest port or station. The emissions calculation will then reflect the updated distance and adjusted source/destination inputs, ensuring maximum accuracy.Understanding your results
Once the request has been made, you can expect to see alegs
array as you would with any shipment emission estimate calculation request. However, any leg that has had inference applied in either of the two ways described above, will have an additional resolved_legs
object nested within the leg
object. If additional leg inference is applied, there may be several resolved_legs
objects nested within a single leg
object.The response object includes will include the following properties:resolved_legs.mass
resolved_legs.distance
methodology_details.route_inference
resolved_legs
object, please refer to the API reference.The following is the legs
object of a sample response to a request with a single cargo air transport leg. Given the source and destination provided, the single leg was converted into three legs, returned in the resolved_legs
object. The response has been edited for brevity.
external_estimate_url
or dashboard_url
properties of the API response, respectively.