Skip to content

feat(import): Added Prioritization for GEOM#4101

Open
christophe-ramet wants to merge 1 commit intodevelopfrom
feat/import/implement_priority_for_geom
Open

feat(import): Added Prioritization for GEOM#4101
christophe-ramet wants to merge 1 commit intodevelopfrom
feat/import/implement_priority_for_geom

Conversation

@christophe-ramet
Copy link
Copy Markdown
Contributor

@christophe-ramet christophe-ramet commented Apr 23, 2026

Proposition d'ajout d'un système de priorisation dans l'import des geoms.

Jusqu'ici si un WKT et un XY etait renseigné, une erreur se produisait sur la ligne.

L'idée de cette PR et de simplement remonter un warning quand c'est le cas et de sélectionner automatiquement la geom la plus précise.

La propositon d'ordre pour le choix des geoms est :

WKT > X/Y > Maille > Commune > Departement
closes #4099

@christophe-ramet christophe-ramet force-pushed the feat/import/implement_priority_for_geom branch from 4a4250f to e9cd902 Compare April 23, 2026 14:33
@christophe-ramet christophe-ramet force-pushed the feat/import/implement_priority_for_geom branch from e9cd902 to 2f21511 Compare April 23, 2026 15:12
Now, WKT > X/Y > code Maille > Code Muncipalité > Code departement . If two of them are present we return a new warning :MULTIPLE_GEO_INFO_WARNING
@christophe-ramet christophe-ramet force-pushed the feat/import/implement_priority_for_geom branch from 2f21511 to 5815899 Compare April 23, 2026 15:15
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.61%. Comparing base (0d51c74) to head (5815899).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4101      +/-   ##
===========================================
+ Coverage    86.59%   86.61%   +0.02%     
===========================================
  Files          138      138              
  Lines        10881    10880       -1     
===========================================
+ Hits          9422     9424       +2     
+ Misses        1459     1456       -3     
Flag Coverage Δ
pytest 86.61% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@jacquesfize jacquesfize left a comment

Choose a reason for hiding this comment

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

Dans l'idée, je trouve ça plus logique. Il faut ajouter une courte section dans la documentation pour indiquer ce comportement.

Mise à part la remarque sur l'ajout des nouvelles mailles 2km, 20km et 50km, ça me semble bien. Par contre, je me retrouve avec une erreur si j'ai un code maille mais pas de x/y ni de wkt. C'est pas souhaitable je pense.

transient_table = imprt.destination.get_transient_table()

for field, area_type_filter in [
(codemaille_field, BibAreasTypes.type_code.in_(["M1", "M5", "M10"])),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
(codemaille_field, BibAreasTypes.type_code.in_(["M1", "M5", "M10"])),
(codemaille_field, BibAreasTypes.type_code.in_(["M1", "M2","M5", "M10","M20","M50"])),

De nouvelles mailles sont disponibles dans la https://github.com/PnX-SI/RefGeo/releases/tag/1.5.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants