PT: the 2025 edition, and the right id - #243
Open
ivorbosloper wants to merge 1 commit into
Open
Conversation
ivorbosloper
force-pushed
the
split/pt
branch
from
September 11, 2026 19:54
e112d54 to
80cb910
Compare
This was referenced Sep 11, 2026
ivorbosloper
force-pushed
the
split/pt
branch
from
September 12, 2026 12:51
80cb910 to
c734015
Compare
ivorbosloper
added a commit
that referenced
this pull request
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
added a commit
that referenced
this pull request
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
IFAP restructured the download for 2025: the country arrives as T<NUTS3> layers instead of Culturas_<district>, the crop code is PUN_CUL_CO instead of CUL_CODIGO, there is no crop name, and the file is WGS 84 with Shape_Area and Shape_Length in degrees, so the area is recomputed on EPSG:6933. The identifier was also the wrong way round: OSA_ID is the land occupation polygon, while CUL_ID identifies the crop parcel and is unique across every layer of both editions. Testing one converter on two editions needs a way to name them, so an entry in the test list may be "<id>#<label>": pt stays pinned to 2023 and pt#2025 covers the new shape, both reading 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
force-pushed
the
split/pt
branch
from
September 12, 2026 15:11
c734015 to
d429ec4
Compare
ivorbosloper
added a commit
that referenced
this pull request
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IFAP restructured the download for 2025 and almost nothing matches 2023:
Culturas_<district>T<NUTS3>CUL_CODIGOPUN_CUL_COThe area is recomputed on EPSG:6933 for 2025. The identifier was also the wrong way round:
OSA_IDis the land-occupation polygon,CUL_IDthe crop parcel, unique across every layer of both editions.Adds the
"<id>#<label>"form to the test list so one converter can be tested on two editions;dk(#258) uses it too.🤖 Generated with Claude Code
https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG