diff --git a/geoviews/operation.py b/geoviews/operation.py index 1db9f7a6..8b2fd1b4 100644 --- a/geoviews/operation.py +++ b/geoviews/operation.py @@ -165,7 +165,7 @@ def _fast_process(self, element, key=None): else: array = element.dimension_values(2, flat=False) - (x0, x1), (y0, y1) = element.range(0), element.range(1) + (x0, y0, x1, y1) = element.bounds.lbrt() width = int(w) if self.p.width is None else self.p.width height = int(h) if self.p.height is None else self.p.height @@ -175,8 +175,11 @@ def _fast_process(self, element, key=None): xvalues = [] for xb in bounds['x']: px0, py0, px1, py1 = project_extents((xb[0], yb[0], xb[1], yb[1]), element.crs, proj) - xfraction = (xb[1]-xb[0])/(x1-x0) - fraction_width = int(width*xfraction) + if len(bounds['x']) > 1: + xfraction = (xb[1]-xb[0])/(x1-x0) + fraction_width = int(width*xfraction) + else: + fraction_width = width xs = np.linspace(px0, px1, fraction_width) ys = np.linspace(py0, py1, height) cxs, cys = cartesian_product([xs, ys]) @@ -186,6 +189,10 @@ def _fast_process(self, element, key=None): icys = (((pys-y0) / (y1-y0)) * h).astype(int) xvalues.append(xs) + icxs[icxs<0] = 0 + icys[icys<0] = 0 + icxs[icxs>=w] = w-1 + icys[icys>=h] = h-1 resampled_arr = array[icys, icxs] if isinstance(element, RGB): nvdims = len(element.vdims) diff --git a/geoviews/plotting/bokeh/__init__.py b/geoviews/plotting/bokeh/__init__.py index 35e82927..1b5c7a35 100644 --- a/geoviews/plotting/bokeh/__init__.py +++ b/geoviews/plotting/bokeh/__init__.py @@ -68,12 +68,12 @@ class GeoPointPlot(GeoPlot, PointPlot): class GeoRasterPlot(GeoPlot, RasterPlot): - _project_operation = project_image.instance(fast=True) + _project_operation = project_image.instance(fast=False) class GeoRGBPlot(GeoPlot, RGBPlot): - _project_operation = project_image.instance(fast=True) + _project_operation = project_image.instance(fast=False) class GeoPolygonPlot(GeoPlot, PolygonPlot):