Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added data calculs during exports from postgres to mongo #266

Merged

Conversation

antoineludeau
Copy link
Member

@antoineludeau antoineludeau commented Sep 21, 2023

Prerequisite : postgis must be installed on postgres DB

I. Context

In the new internal main postgres DB (where we store the data from BAL with BAN-ID), we do not store data that does not come from the BAL. As a consequence, we don't have the additional data we need : fantoir code, postal code, map tiles, ...

II. Enhancement

This PR aims to calculate, during the export from postgres to mongo, the following data :

  • Fantoir code on common toponyms ONLY
  • Postal code on common toponyms and on addresses
  • Map tiles on on common toponyms and on addresses

III. How to test

1- Download a BAL (csv)
2- Use the 'initBALIntoBAN' script of ID-Fix to push data into the BAN DB
3- Wait a few seconds for the export to be done
4- Check in your mongoDB to check on common toponyms and addresses "meta"

Exemple of an address that has those extra data calculated :

{
 ...
  "meta": {
    "geography": {
      "tiles": [
        "12/2063/1495",
        "13/4127/2991",
        "14/8254/5983"
      ],
      "x": 568642.87,
      "y": 6277331.1
    },
    "laposte": {
      "codePostal": "31100"
    }
...
}

Exemple of a common toponym :

{
...
  "meta": {
    "dgfip": {
      "fantoir": "0740"
    },
    "geography": {
      "tiles": [
        "10/516/373",
        "11/1032/747",
        "12/2064/1495",
        "13/4129/2990",
        "14/8258/5980"
      ],
      "x": 576189.38,
      "y": 6282778.42
    },
    "laposte": {
      "codePostal": "31200"
    }
...
}

Copy link
Contributor

@mmortier mmortier left a comment

Choose a reason for hiding this comment

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

Le calcul du code fantoir tel qu'implémenté ici va présenter des régressions importantes sur les communes fusionnées. Le calcul doit prendre en compte les étapes de calcul et les particularités associées aux communes anciennes cf recompute-codes-voies.cjs.

@antoineludeau antoineludeau force-pushed the antoineludeau/add-fantoir-and-tiles-to-export-to-mongo branch 4 times, most recently from e6d1bd1 to 001d625 Compare September 28, 2023 12:53
@antoineludeau antoineludeau force-pushed the antoineludeau/add-fantoir-and-tiles-to-export-to-mongo branch from 001d625 to 107b016 Compare September 28, 2023 14:01
@mmortier
Copy link
Contributor

mmortier commented Oct 3, 2023

J'ai créé un ticket pour prendre en compte l'ancienne commune dans le calcul du code fantoir. Il sera à traiter avant d'écraser le résultat des collections legacy

@mmortier mmortier self-requested a review October 3, 2023 09:19
@antoineludeau antoineludeau merged commit 3ead60d into master Oct 4, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants