Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencies = [
"pydantic-settings~=2.0",
"pandas==1.5.3",
"redis",
"fastapi>=0.100.0,<0.107.0",
"starlette<0.28",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion titiler/xarray/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def map_viewer(
"request": request,
"tilejson_endpoint": tilejson_url,
"tms": tms,
"resolutions": [tms._resolution(matrix) for matrix in tms],
"resolutions": [matrix.cellSize for matrix in tms],
},
media_type="text/html",
)
Expand Down
10 changes: 5 additions & 5 deletions titiler/xarray/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ def get_variable(
da = da.sel({dim_to_drop: dim_val}).drop(dim_to_drop)
da = arrange_coordinates(da)

if (da.x > 180).any():
# Make sure we have a valid CRS
crs = da.rio.crs or "epsg:4326"
da.rio.write_crs(crs, inplace=True)

if crs == "epsg:4326" and (da.x > 180).any():
# Adjust the longitude coordinates to the -180 to 180 range
da = da.assign_coords(x=(da.x + 180) % 360 - 180)

# Sort the dataset by the updated longitude coordinates
da = da.sortby(da.x)

# Make sure we have a valid CRS
crs = da.rio.crs or "epsg:4326"
da.rio.write_crs(crs, inplace=True)

if "time" in da.dims:
if time_slice:
time_as_str = time_slice.split("T")[0]
Expand Down