Skip to content

chore: add road transport to airport or to port#1782

Draft
cedricr wants to merge 6 commits intomasterfrom
chore/1519-prepare-truck-distances
Draft

chore: add road transport to airport or to port#1782
cedricr wants to merge 6 commits intomasterfrom
chore/1519-prepare-truck-distances

Conversation

@cedricr
Copy link
Collaborator

@cedricr cedricr commented Feb 10, 2026

🔧 Problem

Fix #1778

See also: MTES-MCT/ecobalyse-data#211

🍰 Solution

Updates the countries.json file with values for distances to port and airport. The new format is

  {
    "aquaticPollutionScenario": "Best",
    "averageDistanceToAirport": 500,
    "averageDistanceToPort": 500,

🚨 Points to watch/comments

This should not be merged until the frontend is ready!

@cedricr
Copy link
Collaborator Author

cedricr commented Feb 10, 2026

Note : I have to fix the prettier issue (this file should not be checked by prettier, as it is formatted on the data side

Copy link
Member

@n1k0 n1k0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, client needs to be updated to consume this new format, I'll do that on top of this branch

@n1k0
Copy link
Member

n1k0 commented Feb 10, 2026

@cedricr build is failing with a json formatting issue you might want to fix before I take over the patch :)

[warn] Code style issues found in the above file. Run Prettier with --write to fix.

Edit: damn missed your comment about this, scratch my comment

@cedricr cedricr force-pushed the chore/1519-prepare-truck-distances branch from 6afda52 to c88e9f5 Compare February 10, 2026 16:59
@cedricr
Copy link
Collaborator Author

cedricr commented Feb 10, 2026

@paulboosz I’ve fixed the prettier issue, but maybe we should consider excluding all the public/data folder, instead of adding all its files one by one 😅. Or, if some of the files inside are not coming from the data repo, establish a clearer separation.

@cedricr
Copy link
Collaborator Author

cedricr commented Feb 10, 2026

@nicolaspkandeel looks good to you too ? We can even add other transportation means later on (rail, etc.)

{
      "air": {
        "byPlane": 500,
        "byTruck": 500
      },
      "road": 500,
      "sea": {
        "byBoat": null,
        "byTruck": null
      }
}

@cedricr
Copy link
Collaborator Author

cedricr commented Feb 10, 2026

@cedricr build is failing with a json formatting issue you might want to fix before I take over the patch :)

[warn] Code style issues found in the above file. Run Prettier with --write to fix.

Edit: damn missed your comment about this, scratch my comment

@n1k0 the prettier problem is fixed, but the tests fails, which… is expected for now I guess.

@n1k0
Copy link
Member

n1k0 commented Feb 10, 2026

@n1k0 the prettier problem is fixed, but the tests fails, which… is expected for now I guess.

Indeed, I'll take over from there 👍

@nicolaspkandeel
Copy link
Collaborator

nicolaspkandeel commented Feb 10, 2026

@nicolaspkandeel looks good to you too ? We can even add other transportation means later on (rail, etc.)

{
      "air": {
        "byPlane": 500,
        "byTruck": 500
      },
      "road": 500,
      "sea": {
        "byBoat": null,
        "byTruck": null
      }
}

Looks like there is only 500km truck in this config, not 1000 (500km in the country of departure + 500km in the country of arrival). For transport within a country it is fine (there is a rule to refuse the distance for very small distance) but not in other situations.

It would be more intuitive to me to have the 500km as a parameter attached to a country/région, and not directly written in the table of distances.
Thus the total transport would be (for sea transport) 1+2+3:

  1. internal transport by Truck in région of origin
  2. Distance by boat between the two régions
  3. Internal transport by Truck in région of destination

Did you considered this option ?
NB I guess such a distance could also be used as the distance for "distribution"

Then, I see that the distances with unknown region is still defined here, whereas it is a default value. It is confusing. If there is a good reason for that just ignore this last comment.

@cedricr
Copy link
Collaborator Author

cedricr commented Feb 11, 2026

It would be more intuitive to me to have the 500km as a parameter attached to a country/région, and not directly written in the table of distances. Thus the total transport would be (for sea transport) 1+2+3:
(…)
Did you considered this option ? NB I guess such a distance could also be used as the distance for "distribution"

@nicolaspkandeel Excellent points ! I’ll migrate the values to the countries file.

@cedricr cedricr force-pushed the chore/1519-prepare-truck-distances branch from 78ebefc to 8aee599 Compare February 11, 2026 17:43
@cedricr cedricr requested a review from n1k0 February 11, 2026 17:44
@cedricr
Copy link
Collaborator Author

cedricr commented Feb 11, 2026

@nicolaspkandeel I’ve added

    "averageDistanceToAirport": 500,
    "averageDistanceToPort": 500,

to each country. We can talk later on about how to get a more precise estimate.

@n1k0 works for you?

Copy link
Member

@n1k0 n1k0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah for some reason I missed I was tagged with an open question asked, sorry! The latest changes to the format looks good and I feel like countries.json file is indeed the right place to have country-specific internal transportation distances information defined and handled. So, that works for me!

I'm taking over the branch and will implement #1531 right here.

@n1k0 n1k0 self-assigned this Feb 24, 2026
@n1k0 n1k0 added this to Ecobalyse Feb 24, 2026
@github-project-automation github-project-automation bot moved this to Backlog in Ecobalyse Feb 24, 2026
@n1k0 n1k0 moved this from Backlog to In Progress in Ecobalyse Feb 24, 2026
@n1k0 n1k0 added the objects Anything related to the objects scope label Feb 24, 2026
@n1k0 n1k0 force-pushed the chore/1519-prepare-truck-distances branch from 8aee599 to 319577c Compare February 24, 2026 15:55
@n1k0 n1k0 force-pushed the chore/1519-prepare-truck-distances branch from b561ef1 to 5dcae3a Compare February 24, 2026 16:29
cedricr added a commit to MTES-MCT/ecobalyse-data that referenced this pull request Mar 5, 2026
## 🔧 Problem

Fix MTES-MCT/ecobalyse#1778

See also MTES-MCT/ecobalyse#1782


## 🍰 Solution

Updates the transports.json file with nested values for sea and air
transport. The new format is

```
{
      "air": {
        "byPlane": 500,
        "byTruck": 500
      },
      "road": 500,
      "sea": {
        "byBoat": null,
        "byTruck": null
      }
}
```


## 🚨  Points to watch/comments

This should not be merged until the frontend is ready!
@camcoq-start camcoq-start moved this from In Progress to Blocked in Ecobalyse Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

objects Anything related to the objects scope

Projects

Status: Blocked

Development

Successfully merging this pull request may close these issues.

Ajouter distance intrapays pour le transport par camion

3 participants