Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
HansVRP committed Nov 14, 2024
1 parent 5a318cc commit fa3f3fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/openeo_gfmap/manager/job_splitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def append_h3_index(
"""Append the H3 index to the polygons."""

# Project to Web mercator to calculate centroids
original_crs = polygons.crs

polygons = polygons.to_crs(epsg=3857)
geom_col = polygons.geometry.centroid
# Project to lat lon to calculate the h3 index
Expand All @@ -115,6 +117,8 @@ def append_h3_index(
polygons["h3index"] = geom_col.apply(
lambda pt: h3.latlng_to_cell(pt.y, pt.x, grid_resolution)
)
polygons.to_crs(original_crs)

return polygons


Expand Down
Binary file modified tests/tests_integration/results/latlon_features_cdse.nc
Binary file not shown.
Binary file modified tests/tests_integration/results/patch_features_cdse.nc
Binary file not shown.
Binary file modified tests/tests_integration/results/s1_rescaled_features_cdse.nc
Binary file not shown.

0 comments on commit fa3f3fd

Please sign in to comment.