Skip to content

CZ: editions 2019-2026 - #239

Merged
ivorbosloper merged 3 commits into
mainfrom
split/cz
Sep 14, 2026
Merged

ivorbosloper merged 3 commits into
mainfrom
split/cz

Conversation

@ivorbosloper

@ivorbosloper ivorbosloper commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

CZ 2019-2022 support

The 2026 download puts the shapefile in a subfolder, where earlier editions kept
it at the root, so the conversion looked for a file that was there all along.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG
@ivorbosloper ivorbosloper changed the title CZ: find the shapefile wherever the archive nests it CZ: editions 2019-2026 Sep 12, 2026
The archives before 2023 are a different release. GPZ_DP calls the crop name
PLODINA_NA and the declared area DEKL_VYMER, carries no application date, and
identifies nothing per row: ENTITA_ID is the land block and repeats once per
crop declared on it — 242,754 distinct over the 282,462 rows of 2019. Rename
the columns, keep ENTITA_ID as block_id, count the fields positionally for
the id, and date the edition by its campaign year.

The 2020 release then fills PLODINA_ID in 5,804 of its 297,680 rows and names
the crop in all of them, in the ministry's own vocabulary — it writes
"Pšenice ozimá" where EuroCrops writes "Pšenice setá ozimá", so cz_2023.csv
matches only a third of the names. The codes come from a name table built out
of the 2019, 2021 and 2022 editions: 268 names, none carrying two codes,
agreeing with the 5,804 rows of 2020 that do have one, and covering all but
0.004% of them.

cz_2023.csv maps the code list of the 2023 release. The older editions
declare 120 codes outside it (11.4% of their rows: fallow, ware potatoes,
spelt, poppy, ryegrass, the alfalfa and clover mixes) and the newer ones 47
more (0.64%: the hemp varieties the ministry lists one by one, grasses,
vegetable-and-herb mixes, and the strips and landscape features that are no
crop at all). 68 of them are the same crop the current editions still declare
under another code, so they take the HCAT that code already has; the rest are
mapped against hcat3.csv. Without the table the backfilled editions carry no
HCAT for a ninth of their fields; with it, none of the eight editions leaves
a single crop unmapped.

Last, the 2026 edition lists one declaration twice, once per land block it
straddles, with the whole declaration's geometry both times. Keep the first
of each such repeat; a repeat whose shape differs is not this case and still
fails the identity check.

The test harness gains the "<id>#<label>" form, as in #243, to run
the second and third editions from the same folder of input files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG
@ivorbosloper
ivorbosloper merged commit 9ca24e4 into main Sep 14, 2026
7 checks passed
@ivorbosloper
ivorbosloper deleted the split/cz branch September 14, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants