Skip to content

Commit

Permalink
Reuse existing infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Oct 4, 2023
1 parent bf34dd1 commit 6de2ad6
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,6 @@ def __init__(

if self.crs and global_extent:
plot_opts['global_extent'] = global_extent
if projection:
plot_opts['projection'] = process_crs(projection)
title = title if title is not None else getattr(self, '_title', None)
if title is not None:
plot_opts['title'] = title
Expand Down Expand Up @@ -1262,12 +1260,12 @@ def method_wrapper(ds, x, y):
obj = method(x, y)
obj._dataset = dataset

if self.crs and self.project:
# Apply projection before rasterizing
import cartopy.crs as ccrs
from geoviews import project
projection = self._plot_opts.get('projection', ccrs.GOOGLE_MERCATOR)
obj = project(obj, projection=projection)
if self.geo and self.crs != self.output_projection:
import geoviews as gv
if isinstance(obj, gv.element.geo._Element):
obj.opts(projection=self.output_projection)
else:
obj = gv.project(obj, projection=self.output_projection)

if not (self.datashade or self.rasterize or self.downsample):
layers = self._apply_layers(obj)
Expand Down Expand Up @@ -1362,10 +1360,6 @@ def method_wrapper(ds, x, y):
if self._dim_ranges.get('c', (None, None)) != (None, None):
style['clim'] = self._dim_ranges['c']

if self.geo and self.crs != self.output_projection:
import geoviews as gv
obj = gv.project(obj, projection=self.output_projection)

processed = operation(obj, **opts)

if self.dynspread:
Expand Down

0 comments on commit 6de2ad6

Please sign in to comment.