Skip to content

Converter for Spain (whole), based on the FEGA 2025+ data - #206

Open
ivorbosloper wants to merge 5 commits into
mainfrom
ES
Open

Converter for Spain (whole), based on the FEGA 2025+ data#206
ivorbosloper wants to merge 5 commits into
mainfrom
ES

Conversation

@ivorbosloper

Copy link
Copy Markdown
Collaborator

No description provided.

@ivorbosloper
ivorbosloper requested a review from m-mohr May 19, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Spain-wide converter (es) based on FEGA 2025+ “Cultivos Declarados SIGPAC” provincial GeoPackages, while preserving existing region-specific Spain converters by extracting their shared logic into a separate base module.

Changes:

  • Introduce a new national Spain converter (fiboa_cli/datasets/es.py) with schema mappings, ID construction, layer filtering, and URL discovery.
  • Extract the legacy Spain base converter into fiboa_cli/datasets/es_base.py and update Spain region converters to import it.
  • Extend conversion tests and update registry ignore rules + changelog entry.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_convert.py Adds es to the converter test matrix and provides a local test input archive.
fiboa_cli/registry.py Updates ignored_datasets to ignore es_base.py instead of the former base-in-es.py.
fiboa_cli/datasets/es.py Adds the new Spain-wide FEGA 2025+ converter implementation, including get_urls().
fiboa_cli/datasets/es_base.py New module holding the legacy Spain SIGPAC land-use base converter used by regional datasets.
fiboa_cli/datasets/es_vc.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_pv.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_nc.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_md.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_ib.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_ga.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_ex.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_cm.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_cl.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_cb.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_ar.py Updates import to use ESBaseConverter from es_base.py.
fiboa_cli/datasets/es_an.py Updates import to use ESBaseConverter from es_base.py.
CHANGELOG.md Adds an Unreleased changelog entry for the Spain-wide FEGA 2025+ converter.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

class ESBaseConverter(FiboaBaseConverter):
"""
Base Converter for Spain
Asssumes a source column with the SIGPAC-Land Use code
Comment thread fiboa_cli/datasets/es.py
Comment on lines +117 to +121
# The directory listing is a classic Apache-style HTML index; parse out the .zip hrefs.
zip_paths = re.findall(r'HREF="(/geopackages/[^"]+\.zip)"', response.text)
if not zip_paths:
raise RuntimeError(f"No GeoPackage archives found at {base}")
return {f"https://sigpac-hubcloud.es{p}": ["*.gpkg"] for p in zip_paths}
Comment on lines +1 to 4
from .es_base import ESBaseConverter


class ESCLConverter(ESBaseConverter):
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.

3 participants