# Transportation distances

Open Food Facts can inform the user on distances involved in the consumption of food. This already partially done by the MadeNearMe website. This can be extended and better integrated within OFF itself. And not only the distance can be added, but also the implied CO2 impact.

The idea is based on the Transportation part of the ecoscore.

## Approximations

Unfortunately the information on packaging does not allow us to make exact calculations: most of the required information is lacking. If we are fortunate we have the location of the production. With the location of consumption we could calculate the exact distance thanks to OpenStreetMap (or Google Maps). However we do not know anything about the logistical route the product took between the two locations. So accuracy to the kilometer is impossible. We need to take averages.

So we need to make some assumptions:

*population based*: take into account the population size of a region to get better estimates;*simple logistical country chain*: make assumptions how a product is transported between countries. Go from a local production level to the country production center, to the consumption country center to the local consumption level. This also makes the calculations easier;*NUTS*: use the EU statistical regions. Depending on the required accuracy, it is possible to select a specific NUTS-level. We can start with NUTS-1;*Google Maps distances*: use Google Maps to calculated distances. These seem to be more trustworthy than the OpenStreetMap distances;*Fallback*: if specific locations are not available, it is possible to fall back to country averages;*Ingredients*: integrate the transport impact of the ingredients as already defined by the ecoscore;

## Calculation

What do we want to calculate? Just the distances? Or also the CO_{2}-impact?

What distances do we take? By road? By boat? Or a mix? And if both are possible, when do we use one or the other?

If we calculate the CO_{Subscript text}2-impact we need to make additional assumptions.

For the purpose of emphasising the (total) distance traveled by product and its ingredients, we should stay with the distances. We can use a 2000 km cutoff limit for transport by road, below we use road, above we use boat.

### Formula

Distance_{total}= Distance_{ingredients}+ Distance_{wholesale}+ Distance_{distribution}

The total distance formula consists of three parts:

- ingredients: the transportation of the ingredients to the production site;
- wholesale: the transportation of the finished product to the reseller;
- distribution: the transportation from the reseller to the consumer;

#### Wholesale

The part of the distance concerns the transport from the production location to the reseller warehouse. This might involve the transport between two countries.

Distance_{wholesale}= Distance_{producer}+ Distance_{inter-country}+ Distance_{warehouse}

In this we have:

- Distance
_{producer}- the distance between the producer NUTS-location to the centroid of the country; - Distance
_{inter-country}- the distance between the country centroids of the producer and reseller; - Distance
_{warehouse}- the distance between the centroid of the country and the reseller warehouse. Usually the location of the reseller warehouse will be assumed to be the same as country centroid, so set to zero;

#### Distribution

The distribution part of the formula concern only transport within a single country. It concerns the transportation from a wholesale warehouse of the reseller to the consumer. For this we should know the location of the warehouse and consumer to the NUTS-level that we want to use. If this is unknown, we can use a larger area NUTS-level or the entire country. We need to calculate the distance between the NUTS-area centroid of the wholesale location and the NUTS-area centroid of the consumer location. If we must assume the entire country, then the country sizes can be used as approximation.

These distances are tabulated in various spreadsheets for the NUTS-1 levels:

Country | NUTS-level | Spreadsheet link |
---|---|---|

France | NUTS-1 | Example |

Germany | NUTS-2 | Example |

Example | Example | Example |