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
50 changes: 49 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pydggsapi/dependencies/api/mercator.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ def __init__(self):
17: {"Tiles": 17179869184, "Tile width deg lons": 0.00275, "m per pixel": 1.194},
18: {"Tiles": 68719476736, "Tile width deg lons": 0.001375, "m per pixel": 0.597},
19: {"Tiles": 274877906944, "Tile width deg lons": 0.0006875, "m per pixel": 0.299},
20: {"Tiles": 1099511627776, "Tile width deg lons": 0.00034375, "m per pixel": 0.149}
20: {"Tiles": 1099511627776, "Tile width deg lons": 0.00034375, "m per pixel": 0.149},
21: {"Tiles": 4398046511104, "Tile width deg lons": 0.000171661, "m per pixel": 0.07},
22: {"Tiles": 17592186044416, "Tile width deg lons": 0.000085831, "m per pixel": 0.03},
}

def get(self, zoom):
# zoom must be integer and between 0 and 20 inclusive
if not isinstance(zoom, int):
raise TypeError("zoom must be integer")
if zoom < 0 or zoom > 20:
raise ValueError("zoom must be between 0 and 20 inclusive")
if zoom < 0 or zoom > 22:
raise ValueError("zoom must be between 0 and 22 inclusive")

return self.zoom_info[zoom]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def get_data(self, zoneIds: List[Any], res: int, datasource_id: str,
else:
cols = OrderedSet(ds.data_vars) if ("*" in datasource.data_cols) else OrderedSet(datasource.data_cols)
cols = list(cols - OrderedSet(datasource.exclude_data_cols))
zarr_result = ds.query({id_col: f'{id_col} in {zoneIds}'})
dimension = ds[id_col].dims[0]
zarr_result = ds.query({dimension: f'{id_col} in {zoneIds}'})
zarr_result = zarr_result[cols]
except Exception as e:
# Zarr will raise exception if nothing matched
Expand Down
Loading
Loading