{"action":"created","issue":{"url":"https://api.github.com/repos/ioam/geoviews/issues/191","repository_url":"https://api.github.com/repos/ioam/geoviews","labels_url":"https://api.github.com/repos/ioam/geoviews/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/ioam/geoviews/issues/191/comments","events_url":"https://api.github.com/repos/ioam/geoviews/issues/191/events","html_url":"https://github.com/ioam/geoviews/issues/191","id":331960707,"node_id":"MDU6SXNzdWUzMzE5NjA3MDc=","number":191,"title":"Fix axis tick labels for non-Mercator projections","user":{"login":"suvarchal","id":15322959,"node_id":"MDQ6VXNlcjE1MzIyOTU5","avatar_url":"https://avatars0.githubusercontent.com/u/15322959?v=4","gravatar_id":"","url":"https://api.github.com/users/suvarchal","html_url":"https://github.com/suvarchal","followers_url":"https://api.github.com/users/suvarchal/followers","following_url":"https://api.github.com/users/suvarchal/following{/other_user}","gists_url":"https://api.github.com/users/suvarchal/gists{/gist_id}","starred_url":"https://api.github.com/users/suvarchal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suvarchal/subscriptions","organizations_url":"https://api.github.com/users/suvarchal/orgs","repos_url":"https://api.github.com/users/suvarchal/repos","events_url":"https://api.github.com/users/suvarchal/events{/privacy}","received_events_url":"https://api.github.com/users/suvarchal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-13T11:51:00Z","updated_at":"2018-06-13T12:35:54Z","closed_at":null,"author_association":"NONE","body":"I use the functionality of bokeh tools in my plots comprising coastlines, the default Web-Mercator projection makes my plots not very appealing. So in almost all of my applications, I use the following function to get a rectangular projection/native projection of the data. I wonder if something like this should go inside `geoviews.feature` when bokeh backend is used or at least part of bokeh [examples](http://geo.holoviews.org/user_guide/Working_with_Bokeh.html). This was limiting for me for a while so I guess should be useful for others. \r\n\r\n![bokeh_plot](https://user-images.githubusercontent.com/15322959/41349562-8aa0b5ba-6f10-11e8-887e-aa6a24ed731b.png)\r\n\r\n```\r\ndef coastlines(resolution='110m',lon_360=False):\r\n    \"\"\" A custom method to plot in cylyndrical equi projection, most useful for\r\n        native projections, geoviews currently supports only Web Mercator in\r\n        bokeh mode.\r\n        \r\n        Other resolutions can be 50m\r\n        \r\n        lon_360 flag specifies if longitudes are from -180 to 180 (default) or 0 to 360\r\n        TODO: if hv.Polygons is used instead of overlay it is way faster but \r\n              something is wrong there.\r\n    \"\"\"\r\n    try:\r\n        import cartopy.io.shapereader as shapereader\r\n        from cartopy.io.shapereader import natural_earth\r\n        import shapefile\r\n        filename = natural_earth(resolution=resolution,category='physical',name='coastline')\r\n    \r\n        sf = shapefile.Reader(filename)\r\n        fields = [x[0] for x in sf.fields][1:]\r\n        records = sf.records()\r\n        shps = [s.points for s in sf.shapes()]\r\n        pls=[]\r\n        for shp in shps:\r\n            lons=[lo for lo,_ in shp]\r\n            lats=[la for _,la in shp]\r\n            if lon_360:\r\n                lats_patch1=[lat for lon,lat in zip(lons,lats) if lon<0]\r\n                lons_patch1=[lon+360.0 for lon in lons if lon<0]\r\n                if any(lons_patch1):\r\n                    pls.append(hv.Path((lons_patch1,lats_patch1))(style={'color':'Black'}))    \r\n                lats_patch2=[lat if lon>=0 else None for lon,lat in zip(lons,lats)]\r\n                lons_patch2=[lon if lon>=0 else None for lon in lons]\r\n                if any(lons_patch2):\r\n                    pls.append(hv.Path((lons_patch2,lats_patch2))(style={'color':'Black'}))\r\n            else:\r\n                pls.append(hv.Path((lons,lats))(style={'color':'Black'}))\r\n        return hv.Overlay(pls)\r\n    except Exception as err:\r\n        print('Overlaying Coastlines not available from holoviews because: {0}'.format(err))\r\n\r\n#example\r\ncoastline=coastlines(lon_360=True) #this may download shape files on first invocation\r\n                                   #if data longitudes are -180 to 180 then lon_360=False\r\n\r\n#use it on holoviews elements\r\nimg*coastline\r\n```\r\n\r\nnot sure if it is more holoviews or geoviews related, but you are a better judge if you think it is useful.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ioam/geoviews/issues/comments/396921742","html_url":"https://github.com/ioam/geoviews/issues/191#issuecomment-396921742","issue_url":"https://api.github.com/repos/ioam/geoviews/issues/191","id":396921742,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjkyMTc0Mg==","user":{"login":"philippjfr","id":1550771,"node_id":"MDQ6VXNlcjE1NTA3NzE=","avatar_url":"https://avatars2.githubusercontent.com/u/1550771?v=4","gravatar_id":"","url":"https://api.github.com/users/philippjfr","html_url":"https://github.com/philippjfr","followers_url":"https://api.github.com/users/philippjfr/followers","following_url":"https://api.github.com/users/philippjfr/following{/other_user}","gists_url":"https://api.github.com/users/philippjfr/gists{/gist_id}","starred_url":"https://api.github.com/users/philippjfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philippjfr/subscriptions","organizations_url":"https://api.github.com/users/philippjfr/orgs","repos_url":"https://api.github.com/users/philippjfr/repos","events_url":"https://api.github.com/users/philippjfr/events{/privacy}","received_events_url":"https://api.github.com/users/philippjfr/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T12:35:54Z","updated_at":"2018-06-13T12:35:54Z","author_association":"MEMBER","body":"Not sure we can handle this in a totally general way for all projections but at minimum we should at least try to fix it for PlateCarree and RotatedPole cases."}}
{"actor":{"display_login":"philippjfr"}}