Skip to content

Commit

Permalink
Make raster render fallback (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci authored Dec 12, 2024
1 parent bf243ed commit 1a089df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion xpublish_wms/grids/regular.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def name(self) -> str:

@property
def render_method(self) -> RenderMethod:
return RenderMethod.Raster
return RenderMethod.Quad

@property
def crs(self) -> str:
Expand Down
16 changes: 11 additions & 5 deletions xpublish_wms/wms/get_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,17 @@ def render(
da,
)
elif ds.gridded.render_method == RenderMethod.Quad:
mesh = cvs.quadmesh(
da,
x="x",
y="y",
)
try:
mesh = cvs.quadmesh(
da,
x="x",
y="y",
)
except Exception as e:
logger.warning(f"Error rendering quadmesh: {e}, falling back to raster")
mesh = cvs.raster(
da,
)
elif ds.gridded.render_method == RenderMethod.Triangle:
triangles = ds.gridded.tessellate(da)
if x is not None:
Expand Down

0 comments on commit 1a089df

Please sign in to comment.