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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- ES-CL: the ITACyL server is https-only, the 2025 shapefiles sit in province subfolders, and C_REFREC is the identifier
- A test refuses a fixture above 5 MB, committed or merely lying in the fixture folder, because a failing convert test downloads the real source there
- ES-MD: find RECINTO.shp wherever the archive puts it
- ES-CAT: the 2024 download is a shapefile package, and 34 crop names new in that edition are mapped
- DE-NDS: give the collection an id (the row index), which it was published without
- DE-BB: ref_ident holds the FLIK (field block reference), not a farmer, and the shapefile is cp1252
- Update vecorel-cli to v0.2.17:
Expand Down
34 changes: 34 additions & 0 deletions fiboa_cli/datasets/data-files/es_cat.csv
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,37 @@ original_code,original_name,translated_name
310,MANDARINER,MANDARIN
311,'ALGARROBA' HERBÀCIA,ALGARROBA
312,ESPÍGOL O LAVANDA,LAVENDER
313,ALOE VERA,ALOE VERA
314,ANTARA VINYA,VINEYARD INTER-ROW
315,"ARANYONER, PRUNYONER",BLACKTHORN (SLOE)
316,"BITXO, VITXO",CHILI PEPPER
317,CIBULET,CHIVES
318,CIVADA I BLAT,OATS AND WHEAT
319,CIVADA I ORDI,OATS AND BARLEY
320,CIVADA I TRITICALE,OATS AND TRITICALE
321,COL KALE,KALE
322,CROTALÀRIA,CROTALARIA (SUNN HEMP)
323,ERBS I CIVADA,BITTER VETCH AND OATS
324,ESPELTA PETITA,EINKORN
325,GINJOLER,JUJUBE
326,LAVANDA X ESPIGOL,LAVANDIN
327,LOT CORNICULAT,BIRD'S-FOOT TREFOIL
328,MALVA,MALLOW
329,MARIALLUÏSA,LEMON VERBENA
330,"MARXANT, BLET",AMARANTH
331,"MENTA VERDA, HERBA DE SANTA MARIA",SPEARMINT
332,"MILL ITALIÀ, CUA DE GUILLA",FOXTAIL MILLET
333,MONGETA VERMELLA,RED KIDNEY BEAN
334,MORER,MULBERRY
335,"NYÀMERA, PATATA DE CANYA",JERUSALEM ARTICHOKE
336,OKRA,OKRA
337,PASSACAMINS,KNOTGRASS
338,"PISANA, ESPELTA BESSONA",EMMER
339,"RAVE PICANT, RAVE RUSTICÀ",HORSERADISH
340,RUIBARBRE,RHUBARB
341,SULLA O ENCLOVA,SULLA (FRENCH HONEYSUCKLE)
342,TARONGER AGRE,BITTER ORANGE TREE
343,VEÇA I RAIGRÀS,VETCH AND RYEGRASS
344,VIMETERA,OSIER WILLOW
345,VIVER - PRODUCTOR MVR,NURSERY (MVR PRODUCER)
346,XIRIMOIER,CHERIMOYA TREE
6 changes: 2 additions & 4 deletions fiboa_cli/datasets/es_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ESCatConverter(FiboaBaseConverter):
variants = {
"2024": {
"https://analisi.transparenciacatalunya.cat/api/views/yh94-j2n9/files/d90f5fca-ddd8-405d-a0d5-90609985e98e?download=true&filename=Cultius_DUN2024_SHP.zip": [
"Cultius_DUN2024_GPKG/CULTIUS_DUN2024.gpkg"
"Cultius_DUN2024_SHP/Cultius_DUN2024_SHP.shp"
]
},
"2023": {
Expand Down Expand Up @@ -54,8 +54,6 @@ class ESCatConverter(FiboaBaseConverter):
"crop:code": "crop:code",
"crop:name_en": "crop:name_en",
}
# Tells GDAL how the shapefile variants are encoded, since a shapefile does not have to say.
# Unrelated to the GeoJSON encoding that vecorel-cli handles, so it is still needed here.
open_options = dict(encoding="utf-8")
column_migrations = {
"campanya": lambda col: pd.to_datetime(col, format="%Y"),
Expand All @@ -68,7 +66,7 @@ def layer_filter(self, layer, uri):

def migrate(self, gdf):
# In 2023 gpkg, names are lowercase. But in 2022 shapefile, case is mixed
to_lower = {k: k.lower() for k in gdf.columns if k != k.lower}
to_lower = {k: k.lower() for k in gdf.columns if k != k.lower()}
if to_lower:
gdf.rename(columns=to_lower, inplace=True)

Expand Down
Loading