Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- Update fr-converter to support 2021/2022 files

## [v0.21.0] - 2026-02-16

- Update vecorel-cli
Expand Down
22 changes: 18 additions & 4 deletions fiboa_cli/datasets/fr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from geopandas import GeoDataFrame
from vecorel_cli.conversion.admin import AdminConverterMixin

from ..conversion.fiboa_converter import FiboaBaseConverter
Expand All @@ -9,17 +10,24 @@ class FRConverter(AdminConverterMixin, AddHCATMixin, FiboaBaseConverter):
variants = {
"2022": {
"https://data.geopf.fr/telechargement/download/RPG/RPG_2-0__GPKG_LAMB93_FXX_2022-01-01/RPG_2-0__GPKG_LAMB93_FXX_2022-01-01.7z.001": [
"RPG_2-0__GPKG_LAMB93_FXX_2022-01-01/RPG/1_DONNEES_LIVRAISON_2023-08-01/RPG_2-0_GPKG_LAMB93_FXX-2022/PARCELLES_GRAPHIQUES.gpkg"
"**/*.gpkg"
]
},
"2024": {
"https://data.geopf.fr/telechargement/download/RPG/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01.7z.001": [],
"https://data.geopf.fr/telechargement/download/RPG/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01.7z.002": [],
"https://data.geopf.fr/telechargement/download/RPG/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01.7z.003": [],
"https://data.geopf.fr/telechargement/download/RPG/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01.7z.004": [],
"https://data.geopf.fr/telechargement/download/RPG/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01/RPG_3-0__GPKG_LAMB93_FXX_2024-01-01.7z.005": [],
},
"2023": {
"https://data.geopf.fr/telechargement/download/RPG/RPG_2-2__GPKG_LAMB93_FXX_2023-01-01/RPG_2-2__GPKG_LAMB93_FXX_2023-01-01.7z": [
"RPG_2-2__GPKG_LAMB93_FXX_2023-01-01/RPG_2-2__GPKG_LAMB93_FXX_2023-01-01.gpkg"
"**/*.gpkg"
]
},
"2021": {
"https://data.geopf.fr/telechargement/download/RPG/RPG_2-0__GPKG_LAMB93_FXX_2021-01-01/RPG_2-0__GPKG_LAMB93_FXX_2021-01-01.7z": [
"RPG_2-0__GPKG_LAMB93_FXX_2022-01-01/RPG/1_DONNEES_LIVRAISON_2021-08-01/RPG_2-0_GPKG_LAMB93_FXX-2021/PARCELLES_GRAPHIQUES.gpkg"
"**/PARCELLES_GRAPHIQUES.gpkg"
]
},
"2020": {
Expand All @@ -44,7 +52,7 @@ class FRConverter(AdminConverterMixin, AddHCATMixin, FiboaBaseConverter):

provider = "Anstitut National de l'Information Géographique et Forestière <https://www.data.gouv.fr/en/datasets/registre-parcellaire-graphique-rpg-contours-des-parcelles-et-ilots-culturaux-et-leur-groupe-de-cultures-majoritaire/>"
# Attribution example as described in the open license
attribution = "IGN Original data from https://geoservices.ign.fr/rpg"
attribution = "IGN - Original data from https://geoservices.ign.fr/rpg"
license = "Licence Ouverte / Open Licence <https://etalab.gouv.fr/licence-ouverte-open-licence>"
ec_mapping_csv = "fr_2018.csv"

Expand All @@ -56,6 +64,12 @@ class FRConverter(AdminConverterMixin, AddHCATMixin, FiboaBaseConverter):
"code_group": "group_code",
}

def migrate(self, gdf) -> GeoDataFrame:
if "ID_PARCEL" in gdf.columns:
# Make column names lowercase, harmonize for different years
gdf = gdf.rename(columns={k: k.lower() for k in gdf.columns}, inplace=True)
return super().migrate(gdf)

column_filters = {
"surf_parc": lambda col: col > 0.0 # fiboa validator requires area > 0.0
}
Expand Down
Loading