holoviz / geoviews

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

Inconsistent behavior with Path projection #145

Open apteryx opened 6 years ago

apteryx commented 6 years ago

geoviews Path elements behave differently depending on the central_longitude of the projection parameter. With the default projection=crs.PlateCarree(central_longitude=0.0), lines on a 0-360 longitude grid are only drawn for points <=180 degrees. With any other central longitude (e.g. central_longitude=0) points > 180 are wrapped to the (-180, 0) range, and paths that cross the dateline are wrapped appropriately as well.

I tried to reproduce this behavior with just pyplot and cartopy, but without geoviews no points are wrapped even with central_longitude=0. However, I can get the behavior I want in this configuration by passing in transform=crs.Geodetic() to the ax.plot call. This makes me think that geoviews is transforming the data only when the central_longitude is not 0.0 but I'm not super familiar with how geoviews, cartopy and matplotlib interact and can't find anything in the source supporting my idea.

Another thought I had is that geoviews is just following a different code path with cartopy than matplotlib does, in which case the source of the strange behavior is cartopy. Either way it seems like it would be good to figure out why this is happening and at least document it to avoid confusion.

philippjfr commented 6 years ago

Thanks for reporting this, at a quick glance I couldn't see why it would treat a float and an integer differently but this is definitely worth investigating.