Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/eopf_geozarr/conversion/geozarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,14 @@ def create_overview_dataset_all_vars(
# Calculate the transform for this overview level
overview_transform = rasterio.transform.from_bounds(*native_bounds, width, height)

# Create coordinate arrays
# Determine coordinate dtype from parent dataset to maintain alignment
parent_x_dtype = ds.coords["x"].dtype if "x" in ds.coords else np.float64
parent_y_dtype = ds.coords["y"].dtype if "y" in ds.coords else np.float64

# Create coordinate arrays preserving parent dtype
left, bottom, right, top = native_bounds
x_coords = np.linspace(left, right, width, endpoint=False)
y_coords = np.linspace(top, bottom, height, endpoint=False)
x_coords = np.linspace(left, right, width, endpoint=False, dtype=parent_x_dtype)
y_coords = np.linspace(top, bottom, height, endpoint=False, dtype=parent_y_dtype)

# Check if we're dealing with geographic coordinates (EPSG:4326)
if native_crs and native_crs.to_epsg() == 4326:
Expand Down