From e78bed7ea9627b490bbc28fd8eb53f346226e4f8 Mon Sep 17 00:00:00 2001 From: Ivor Bosloper Date: Fri, 11 Sep 2026 21:55:54 +0200 Subject: [PATCH] EC-EE: read the release as it is shipped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The converter's missing_schemas marked properties as required that the release does not fill for every parcel, so the conversion failed at write time — one column per run, after the whole file had been read. Checking this needs the whole source rather than the 100-row fixture: a column the source only sometimes fills passes the test and fails the full run. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG --- CHANGELOG.md | 1 + fiboa_cli/datasets/ec_ee.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a654d7dd..85833f6f 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 +- EC-EE: name the shapefile inside the archive, migrate the year column the release actually has, and require only what every parcel carries - 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/ec_ee.py b/fiboa_cli/datasets/ec_ee.py index 682df4d8..13b0cc19 100644 --- a/fiboa_cli/datasets/ec_ee.py +++ b/fiboa_cli/datasets/ec_ee.py @@ -10,7 +10,11 @@ class Convert(EuroCropsConverterMixin, FiboaBaseConverter): ec_mapping_csv = "ee_2021.csv" ec_year = 2021 - sources = "https://zenodo.org/records/14094196/files/EE_2021.zip?download=1" + sources = { + "https://zenodo.org/records/14094196/files/EE_2021.zip?download=1": [ + "EE_2021/EE_2021_EC21.shp" + ] + } id = "ec_ee" short_name = "Estonia" title = "Field boundaries for Estonia" @@ -36,16 +40,16 @@ class Convert(EuroCropsConverterMixin, FiboaBaseConverter): "taotleja_n": "taotleja_nimi", # name of applicant "taotleja_r": "taotleja_registrikood", # applicant's registration code } - column_migrations = {"JAHR": lambda col: pd.to_datetime(col, format="%Y")} + # The shapefile truncates taotlusaasta ("application year") to ten characters; + # it holds a bare year, which has to become a datetime for the STAC extent. + column_migrations = {"taotlusaas": lambda col: pd.to_datetime(col, format="%Y")} missing_schemas = { "required": [ - "taotletud_kultuur", "taotletud_maakasutus", "viimase_muutmise_aeg", "taotleja_nimi", ], "properties": { - "taotletud_kultuur": {"type": "string"}, "taotletud_maakasutus": {"type": "string"}, "niitmise_tuvastamise_staatus": {"type": "string"}, "niitmise_tuvast_ajavahemik": {"type": "string"},