Skip to content

Commit

Permalink
Add raster rendering mode for regular grids (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci authored Dec 9, 2024
1 parent 0739a37 commit bf243ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions xpublish_wms/grids/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


class RenderMethod(Enum):
Raster = "raster"
Quad = "quad"
Triangle = "triangle"

Expand Down
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.Quad
return RenderMethod.Raster

@property
def crs(self) -> str:
Expand Down
6 changes: 5 additions & 1 deletion xpublish_wms/wms/get_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ def render(
y_range=(self.bbox[1], self.bbox[3]),
)

if ds.gridded.render_method == RenderMethod.Quad:
if ds.gridded.render_method == RenderMethod.Raster:
mesh = cvs.raster(
da,
)
elif ds.gridded.render_method == RenderMethod.Quad:
mesh = cvs.quadmesh(
da,
x="x",
Expand Down

0 comments on commit bf243ed

Please sign in to comment.