holoviz / geoviews

Simple, concise geographical visualization in Python
http://geoviews.org
BSD 3-Clause "New" or "Revised" License
592 stars 76 forks source link

Error when specifying cartopy projection settings #40

Closed ResidentMario closed 7 years ago

ResidentMario commented 8 years ago

When projection settings are passed to cartopy inline with the geoviews settings shebang, multi-parameter setting specifications will fail to work correctly.

For instance, here's a minimum working example:

import holoviews as hv
import geoviews as gv
import geoviews.feature as gf
from cartopy import crs
hv.notebook_extension()
g = crs.Orthographic(central_longitude=-98, central_latitude=39)

%%opts Overlay [fig_size=250 projection=g]
gf.land * gf.ocean

Here's a minimum non-working example:

import holoviews as hv
import geoviews as gv
import geoviews.feature as gf
from cartopy import crs
hv.notebook_extension()

%%opts Overlay [fig_size=250 projection=crs.Orthographic(central_longitude=-98, central_latitude=39)]
gf.land * gf.ocean

The latter will raise a Warning that this combination of parameters has been ignored, and the resultant map will be centered on the default axis (0,0) instead of the desired one, (-98, 39).

jbednar commented 8 years ago

Try taking out the space after "-98,". The opts magic parser is not as powerful as Python's.

philippjfr commented 8 years ago

Yes, that's probably the answer.

Linked to https://github.com/ioam/holoviews/issues/270 and https://github.com/ioam/holoviews/issues/874

philippjfr commented 8 years ago

We should investigate whether there is a simple fix for this. The parser can be a bit hairy to fiddle with but there may be something easy we can do.

philippjfr commented 7 years ago

Closing since this is a known issue in holoviews.