Skip to content

Feature full rules#1

Merged
sjpfenninger merged 59 commits intomainfrom
feature-full-rules
Nov 17, 2025
Merged

Feature full rules#1
sjpfenninger merged 59 commits intomainfrom
feature-full-rules

Conversation

@sjpfenninger
Copy link
Copy Markdown
Member

@sjpfenninger sjpfenninger commented Jul 8, 2025

Initial implementation

Missing:

  • Docs
  • Logging
  • ...?

Reviewer checklist

  • INTERFACE.yaml is up-to-date with all relevant user resources and results.
  • The integration example is up-to-date with a minimal use-case of the module.
  • Module documentation is up-to-date.

@irm-codebase
Copy link
Copy Markdown
Member

@sjpfenninger ready for review, I assume?

* Allow per-subunit tech configuration override
* Clean up download rules, download full TIF files by default
* Improve plotting
Copy link
Copy Markdown
Member

@irm-codebase irm-codebase left a comment

Choose a reason for hiding this comment

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

@sjpfenninger Looks good overall!
A few comments. You can choose to ignore nit-picks or optional stuff.

Most important:

  • the need to update to the newest template version before merging this in (changes should be minor in your case).
  • a few clarifications regarding the configuration schema

@jnnr
Copy link
Copy Markdown

jnnr commented Aug 1, 2025

The new ´override´ key in the config is currently not optional. If it's missing, rule area_potential throws a key error.

@irm-codebase
Copy link
Copy Markdown
Member

irm-codebase commented Sep 22, 2025

@sjpfenninger wile digging around in the integrated module workflow, I found a way to avoid having to force users to download the WDPA dataset on their own.

the following curl command should always download the latest version of that dataset

# Full world polygons to GeoJSON
curl -G "https://data-gis.unep-wcmc.org/server/rest/services/ProtectedSites/The_World_Database_of_Protected_Areas/FeatureServer/1/query" \
     --data-urlencode "where=1=1" \  # ask for all records
     --data-urlencode "outFields=*" \  # ask for all columns
     --data-urlencode "outSR=4326" \ # WGS84 (can be another EPSG)
     --data-urlencode "f=geojson" \  # GeoJSON, convert to GeoParquet later
     -o wdpa_poly_latest.geojson

This results in a ~180 MB download that is completed rather quickly

Another alternative is the ogr2ogr command in GDAL (not tested), which can output GeoParquet directly

# Polygons (layer 1) -> GeoParquet
ogr2ogr -f Parquet wdpa_poly_latest.parquet \
  "https://data-gis.unep-wcmc.org/server/rest/services/ProtectedSites/The_World_Database_of_Protected_Areas/FeatureServer/1" \
  -t_srs EPSG:4326 \
  -lco COMPRESSION=SNAPPY -lco GEOMETRY_ENCODING=WKB

@sjpfenninger
Copy link
Copy Markdown
Member Author

@irm-codebase Could you check if you are satisfied with the changes made in response to your review? And thanks for the WDPA data hint - I've moved that to an issue to revisit later, but the API seems hard-limited to 2000 records, so it may not be feasible to use.

Copy link
Copy Markdown
Member

@irm-codebase irm-codebase left a comment

Choose a reason for hiding this comment

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

Looks good overall!
It seems like the integration test is failing, though.

consider this approved, but the integration test must pass.

Comment on lines +20 to +21
geometry: GeoSeries[Point] = Field()
"Shape polygon."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why Point? This one will likely fail... shapefiles can be polygons or multipolygons. I would not validate that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good question - I've now used a subset of the schema from module_geo_boundaries 1:1, to ensure that it is consistent.

@sjpfenninger sjpfenninger merged commit dd34d21 into main Nov 17, 2025
4 checks passed
@sjpfenninger sjpfenninger deleted the feature-full-rules branch November 17, 2025 09:11
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.

4 participants