ES-EX, ES-NC: the recintos FEGA publishes, since the regions do not - #292
ivorbosloper wants to merge 5 commits into
Conversation
Neither converter could run: sitex.gobex.es and sigpac.navarra.es answer nothing, from two networks, and have not since at least 2026-09-10. FEGA publishes the same register per province, for 2025 and 2026, on the hub the national es converter already reads. Extremadura is provinces 06 and 10, Navarra is 31. The columns are the ones ESBaseConverter expects, so both regions keep the crop code, its name, and the land use filter they had. The provider changes with the source: these are FEGA's files now, which the description says. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG
e742404 to
901d40f
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Variant propagation and multipart area handling can produce failed metadata generation and inaccurate areas.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Moves Navarra and Extremadura SIGPAC converters to FEGA’s national provincial releases.
Changes:
- Adds a shared FEGA recinto mixin for downloading, filtering, and ID generation.
- Updates both regional converters for 2025–2026 releases.
- Adds Navarra conversion coverage and changelog documentation.
File summaries
| File | Description |
|---|---|
fiboa_cli/datasets/commons/sigpac.py |
Adds shared FEGA conversion logic. |
fiboa_cli/datasets/es_nc.py |
Migrates Navarra to FEGA data. |
fiboa_cli/datasets/es_ex.py |
Migrates Extremadura to FEGA data. |
tests/test_convert.py |
Adds Navarra fixture coverage. |
CHANGELOG.md |
Documents the source migration. |
Review details
- Files reviewed: 5/6 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| use_variant_as_determination = True | ||
|
|
||
| def get_urls(self): | ||
| listing = requests.get(f"{HUB}/geopackages/{self.variant}/recintos/", timeout=120) |
There was a problem hiding this comment.
See also vecorel/cli#45, which may need a rebase to get into this branch.
There was a problem hiding this comment.
Right about the mechanism, and vecorel/cli#45 fixes it where it matters: BaseConverter.convert() now sets the variant before get_urls() runs, so a converter that overrides get_urls() does not have to default it itself. That is in v0.2.20, which this branch already pins — so no rebase is needed (thanks @m-mohr for the pointer).
The one path #45 does not cover is the one you name: Publish.make_readme() calls get_urls() outside convert(), on a converter whose variant was never set. Worth knowing that this method no longer exists on publish-portolan — #214 removed it, because the catalog generates its own READMEs — and that is the branch the published data is built from, which is why the ES-EX and ES-NC builds were fine.
So it is live on this branch and dead on the one that publishes. Fixing it properly means publish.py setting self.converter.variant before calling, which would help every converter rather than this mixin; defaulting inside get_urls() would only paper over it and, as you say, document the wrong year for an explicit --variant 2025.
Navarra 2026 is 996,640 recintos and Badajoz 1,313,841, all Polygon, no MultiPolygon. The numbering stays: the cadastral key repeats 19 times in Badajoz. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVx9uQV2QPM8ecPAY3ZjXG
Neither converter could run:
sitex.gobex.es(Extremadura) andsigpac.navarra.esanswer nothing, from two networks, and have not since at least 2026-09-10.FEGA publishes the same register per province —
/geopackages/<year>/recintos/on the hub the nationalesconverter already reads — for 2025 and 2026. Extremadura is provinces 06 and 10, Navarra is 31.ESBaseConverterexpects (uso_sigpac,dn_surfacein m²,provincia,municipio), so both regions keep their crop code, its name and the land-use filter.es.pybuilds it for the declared crops of the same parcels.SigpacRecintoMixinholds the shared part, so a third region that loses its portal is a two-line converter. Navarra has a fixture; Extremadura's provinces are 1.8 GB.For fieldsoftheworld/harmonized-field-data-catalog#20.