diff --git a/CHANGELOG.md b/CHANGELOG.md index a654d7dd..9bfa8673 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,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-AN: CD_USO is the land-use column, with the determination date from the variant year - Update vecorel-cli to v0.2.17: - GeoJSON is read as UTF-8 as the format mandates, instead of the platform locale (cp1252 on Windows mangled umlauts) - GeoJSON files with a byte order mark no longer fail to read diff --git a/fiboa_cli/datasets/es_an.py b/fiboa_cli/datasets/es_an.py index b484f3a0..6fcf1fa9 100644 --- a/fiboa_cli/datasets/es_an.py +++ b/fiboa_cli/datasets/es_an.py @@ -45,11 +45,13 @@ class ANConverter(ESBaseConverter): "crop:name_en": "crop:name_en", } + use_code_attribute = "CD_USO" area_is_in_ha = False area_calculate_missing = True + use_variant_as_determination = True - column_additions = ESBaseConverter.column_additions | { - "determination:datetime": "2024-03-28T00:00:00Z", + column_migrations = { + "ID_RECINTO": lambda col: col.astype("int64"), } missing_schemas = { diff --git a/tests/data-files/convert/es_an/SP25_REC_PROV_04.zip b/tests/data-files/convert/es_an/SP25_REC_PROV_04.zip new file mode 100644 index 00000000..6b3b2e42 Binary files /dev/null and b/tests/data-files/convert/es_an/SP25_REC_PROV_04.zip differ diff --git a/tests/test_convert.py b/tests/test_convert.py index d3ce8c7e..fd8ee1ff 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -45,6 +45,7 @@ "ie", "es_cat", "es_cl", + "es_an", "es", "nz", "lt", @@ -83,6 +84,10 @@ def _input_files(converter, *names): "variant": "2025", "input_files": {f"{test_path}/es_cl/AVILA.zip": ["replaceme.zip"]}, }, + "es_an": { + "variant": "2025", + "input_files": {f"{test_path}/es_an/SP25_REC_PROV_04.zip": ["SP25_REC_04.shp"]}, + }, "es_cat": _input_files("es_cat", "Cultius_DUN2023_GPKG.zip"), "es": {"input_files": {f"{test_path}/es/1501_ALAVA_cd_2025_20250105.gpkg.zip": ["*.gpkg"]}}, "lv": _input_files("lv", "1_100.xml"),