-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Cells which cross the -180 / 180 antimeridian are inverted along the long axis in the visualization.
Minimal reproducable example:
from xdggs.h3 import H3Info
level = 3
grid_info = H3Info(level=level)
lon = xr.DataArray(np.arange(-180, 180, 0.25), dims="lon")
lat = xr.DataArray(np.arange(50, 85, 0.25), dims="lat")
lon, lat = xr.broadcast(lon, lat)
h3_ds = xr.Dataset(
coords={
"cell_ids": (
"cells",
grid_info.geographic2cell_ids(lon.data.ravel(), lat.data.ravel()),
grid_info.to_dict(),
)
}
).pipe(xdggs.decode)
h3_ds["lons"] = (["cells"], lon.data.ravel())
h3_ds.lons.dggs.explore()Since the values plotted are the longitudes, this should result in a nice horizontal gradient.
However, this results in:
By removing the antimeridian hexagons with replacing the lons line:
lon = xr.DataArray(np.arange(-180, 180, 0.25), dims="lon")The result is as expected:
I know that Geopandas has the same problem with folium.
Env-Info:
- Python 3.12
- XDGGS: 0.3.0
- lonboard 0.12.1
Metadata
Metadata
Assignees
Labels
No labels