-
Notifications
You must be signed in to change notification settings - Fork 118
feat(import): Added Prioritization for GEOM #4101
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
Open
christophe-ramet
wants to merge
1
commit into
develop
Choose a base branch
from
feat/import/implement_priority_for_geom
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
backend/geonature/migrations/versions/f6a1feb3f297_add_multiple_geo_info_warning.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| """[import] add MULTIPLE_GEO_INFO_WARNING error type | ||
|
|
||
| Revision ID: f6a1feb3f297 | ||
| Revises: cb663f039774 | ||
| Create Date: 2026-04-23 10:00:00.000000 | ||
|
|
||
| """ | ||
|
|
||
| from alembic import op | ||
| import sqlalchemy as sa | ||
| from sqlalchemy.schema import Table, MetaData | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "f6a1feb3f297" | ||
| down_revision = "cb663f039774" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| metadata = MetaData(bind=op.get_bind()) | ||
| bib_errors_types = Table("bib_errors_types", metadata, schema="gn_imports", autoload=True) | ||
| op.execute( | ||
| sa.insert(bib_errors_types).values( | ||
| error_type="Géometrie", | ||
| name="MULTIPLE_GEO_INFO_WARNING", | ||
| description=( | ||
| "Plusieurs informations de géoreferencement ont été remplies pour une même ligne. " | ||
| "La plus précise a été selectionée automatiquement selon cette ordre de priorité : " | ||
| "WKT > longitude/latitude > Maille > Commune > Departement" | ||
| ), | ||
| error_level="WARNING", | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| def downgrade(): | ||
| metadata = MetaData(bind=op.get_bind()) | ||
| bib_errors_types = Table("bib_errors_types", metadata, schema="gn_imports", autoload=True) | ||
| op.execute( | ||
| sa.delete(bib_errors_types).where(bib_errors_types.c.name == "MULTIPLE_GEO_INFO_WARNING") | ||
| ) |
39 changes: 20 additions & 19 deletions
39
backend/geonature/tests/imports/files/synthese/geom_file.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,22 @@ | ||
| date_min;cd_nom;nom_cite;observers;WKT;latitude;longitude;codecommune;codedepartement;codemaille;erreur attendue | ||
| 2017-01-01;67111;Ablette;Toto;;;;13088;;;Valide (codecommune) | ||
| 2017-01-01;67111;Ablette;Toto;;;;code com invalide;;;INVALID_ATTACHMENT_CODE (codecommune) | ||
| 2017-01-01;67111;Ablette;Toto;;;;;13;;Valide (codedépartement) # FIXME invalide altitude_min (bord de mer) | ||
| 2017-01-01;67111;Ablette;Toto;;;;;code dep invalide;;INVALID_ATTACHMENT_CODE (codedepartement) | ||
| 2017-01-01;67111;Ablette;Toto;;;;;;5kmL93E0905N6250;Valide (codemaille) | ||
| 2017-01-01;67111;Ablette;Toto;;;;;;code maille invalide;INVALID_ATTACHMENT_CODE (codemaille) | ||
| 2017-01-01;67111;Ablette;Toto;;;;5101;5;5kmL93E0905N6250;MULTIPLE_CODE_ATTACHMENT | ||
| 2017-01-01;67111;Ablette;Toto;POINT(5.4877 43.3056);;;5101;5;5kmL93E0905N6250;Valide (WKT) | ||
| 2017-01-01;67111;Ablette;Toto;;43.3056;5.4877;5101;5;5kmL93E0905N6250;Valide (X/Y) | ||
| 2017-01-01;67111;Ablette;Toto;POINT(5.4877 43.3056);44.85;6.5;5101;5;5kmL93E0905N6250;MULTIPLE_ATTACHMENT_TYPE_CODE | ||
| 2017-01-01;67111;Ablette;Toto;POINT(5.4877 43.3056);;;;;;Valide (WKT) | ||
| 2017-01-01;67111;Ablette;Toto;;43.3056;5.4877;;;;Valide (X/Y) | ||
| 2017-01-01;67111;Ablette;Toto;;43,3056;5,4877;;;;Valide (X/Y) | ||
| 2017-01-01;67111;Ablette;Toto;POINT(6.5 44.85);44.85;6.5;;;;MULTIPLE_ATTACHMENT_TYPE_CODE | ||
| 2017-01-01;67111;Ablette;Toto;;;;;;;NO-GEOM | ||
| 2017-01-01;67111;Ablette;Toto;POLYGON((0 0, 1 1, 1 2, 1 1, 0 0));;;;;;INVALID_GEOMETRY | ||
| 2017-01-01;67111;Ablette;Toto;POINT(6.5 44.85);;;;;;GEOMETRY_OUTSIDE | ||
| 2017-01-01;67111;Ablette;Toto;;44.85;6.5;;;;GEOMETRY_OUTSIDE | ||
| 2017-01-01;67111;Ablette;Toto;;44.85;;;;;MISSING_VALUE(longitude) | ||
| 2017-01-01;67111;Ablette;Toto;;;6.5;;;;MISSING_VALUE(latitude) | ||
| 2017-01-02;67111;Ablette;Toto;;;;code com invalide;;;INVALID_ATTACHMENT_CODE (codecommune) | ||
| 2017-01-03;67111;Ablette;Toto;;;;;13;;Valide (codedépartement) # FIXME invalide altitude_min (bord de mer) | ||
| 2017-01-04;67111;Ablette;Toto;;;;;code dep invalide;;INVALID_ATTACHMENT_CODE (codedepartement) | ||
| 2017-01-05;67111;Ablette;Toto;;;;;;5kmL93E0905N6250;Valide (codemaille) | ||
| 2017-01-06;67111;Ablette;Toto;;;;;;code maille invalide;INVALID_ATTACHMENT_CODE (codemaille) | ||
| 2017-01-07;67111;Ablette;Toto;;;;5101;5;5kmL93E0905N6250;MULTIPLE_GEO_INFO_WARNING (Use code maille) | ||
| 2017-01-08;67111;Ablette;Toto;POINT(5.4877 43.3056);;;5101;5;5kmL93E0905N6250;MULTIPLE_GEO_INFO_WARNING (use WKT) | ||
| 2017-01-09;67111;Ablette;Toto;;43.5;5.6;5101;5;5kmL93E0905N6250;MULTIPLE_GEO_INFO_WARNING (use xy) | ||
| 2017-01-10;67111;Ablette;Toto;POINT(5.4877 43.3056);43.5;5.6;5101;5;5kmL93E0905N6250;MULTIPLE_GEO_INFO_WARNING (use WKT) | ||
| 2017-01-11;67111;Ablette;Toto;POINT(5.4877 43.3056);;;;;;Valide (WKT) | ||
| 2017-01-12;67111;Ablette;Toto;;43.5;5.6;;;;Valide (X/Y) | ||
| 2017-01-13;67111;Ablette;Toto;;43.5;5.6;;;;Valide (X/Y) | ||
| 2017-01-14;67111;Ablette;Toto;POINT(5.4877 43.3056);43.5;5.6;;;;MULTIPLE_GEO_INFO_WARNING (use WKT) | ||
| 2017-01-15;67111;Ablette;Toto;;;;;;;NO-GEOM | ||
| 2017-01-16;67111;Ablette;Toto;POLYGON((0 0, 1 1, 1 2, 1 1, 0 0));;;;;;INVALID_GEOMETRY | ||
| 2017-01-17;67111;Ablette;Toto;POINT(6.5 44.85);;;;;;GEOMETRY_OUTSIDE | ||
| 2017-01-18;67111;Ablette;Toto;;44.85;6.5;;;;GEOMETRY_OUTSIDE | ||
| 2017-01-19;67111;Ablette;Toto;;43.5;;;;;MISSING_VALUE(longitude) | ||
| 2017-01-20;67111;Ablette;Toto;;;5.6;;;;MISSING_VALUE(latitude) | ||
| 2017-01-21;67111;Ablette;Toto;;;;13088;5;"";MULTIPLE_GEO_INFO_WARNING (Use code commune) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De nouvelles mailles sont disponibles dans la https://github.com/PnX-SI/RefGeo/releases/tag/1.5.4.