Browse Source

Working on datashader

WillKoehrsen 6 years ago
parent
commit
b99d84ee87
47 changed files with 21909 additions and 0 deletions
  1. 684 0
      datashader-work/datashader-tryout.ipynb
  2. 4599 0
      datashader-work/geo-views.ipynb
  3. 94 0
      datashader-work/geoviews-examples/Homepage.ipynb
  4. BIN
      datashader-work/geoviews-examples/assets/boundaries/boundaries.dbf
  5. BIN
      datashader-work/geoviews-examples/assets/boundaries/boundaries.shp
  6. BIN
      datashader-work/geoviews-examples/assets/boundaries/boundaries.shx
  7. 10031 0
      datashader-work/geoviews-examples/assets/cities.csv
  8. 400 0
      datashader-work/geoviews-examples/assets/referendum.csv
  9. 1 0
      datashader-work/geoviews-examples/assets/results.json
  10. BIN
      datashader-work/geoviews-examples/data/ensemble.nc
  11. BIN
      datashader-work/geoviews-examples/data/ensembles.nc
  12. BIN
      datashader-work/geoviews-examples/data/pre-industrial.nc
  13. 10 0
      datashader-work/geoviews-examples/datasets.yml
  14. 90 0
      datashader-work/geoviews-examples/gallery/bokeh/airport_graph.ipynb
  15. 74 0
      datashader-work/geoviews-examples/gallery/bokeh/brexit_choropleth.ipynb
  16. 80 0
      datashader-work/geoviews-examples/gallery/bokeh/city_populations_2050.ipynb
  17. 93 0
      datashader-work/geoviews-examples/gallery/bokeh/filled_contours.ipynb
  18. 92 0
      datashader-work/geoviews-examples/gallery/bokeh/great_circle.ipynb
  19. 119 0
      datashader-work/geoviews-examples/gallery/bokeh/katrina_track.ipynb
  20. 63 0
      datashader-work/geoviews-examples/gallery/bokeh/new_york_boroughs.ipynb
  21. 95 0
      datashader-work/geoviews-examples/gallery/bokeh/orthographic_vectorfield.ipynb
  22. 58 0
      datashader-work/geoviews-examples/gallery/bokeh/tile_sources.ipynb
  23. 115 0
      datashader-work/geoviews-examples/gallery/bokeh/trimesh_uk.ipynb
  24. 74 0
      datashader-work/geoviews-examples/gallery/bokeh/vectorfield_example.ipynb
  25. 79 0
      datashader-work/geoviews-examples/gallery/bokeh/world_population.ipynb
  26. 75 0
      datashader-work/geoviews-examples/gallery/bokeh/xarray_image.ipynb
  27. 71 0
      datashader-work/geoviews-examples/gallery/bokeh/xarray_quadmesh.ipynb
  28. 89 0
      datashader-work/geoviews-examples/gallery/matplotlib/airport_graph.ipynb
  29. 74 0
      datashader-work/geoviews-examples/gallery/matplotlib/brexit_choropleth.ipynb
  30. 80 0
      datashader-work/geoviews-examples/gallery/matplotlib/city_population.ipynb
  31. 91 0
      datashader-work/geoviews-examples/gallery/matplotlib/filled_contours.ipynb
  32. 95 0
      datashader-work/geoviews-examples/gallery/matplotlib/great_circle.ipynb
  33. 116 0
      datashader-work/geoviews-examples/gallery/matplotlib/katrina_track.ipynb
  34. 78 0
      datashader-work/geoviews-examples/gallery/matplotlib/new_york_boroughs.ipynb
  35. 96 0
      datashader-work/geoviews-examples/gallery/matplotlib/orthographic_vectorfield.ipynb
  36. 59 0
      datashader-work/geoviews-examples/gallery/matplotlib/tile_sources.ipynb
  37. 117 0
      datashader-work/geoviews-examples/gallery/matplotlib/trimesh_uk.ipynb
  38. 76 0
      datashader-work/geoviews-examples/gallery/matplotlib/vectorfield_example.ipynb
  39. 77 0
      datashader-work/geoviews-examples/gallery/matplotlib/world_population.ipynb
  40. 75 0
      datashader-work/geoviews-examples/gallery/matplotlib/xarray_image.ipynb
  41. 73 0
      datashader-work/geoviews-examples/gallery/matplotlib/xarray_quadmesh.ipynb
  42. 349 0
      datashader-work/geoviews-examples/user_guide/Geometries.ipynb
  43. 341 0
      datashader-work/geoviews-examples/user_guide/Gridded_Datasets_I.ipynb
  44. 322 0
      datashader-work/geoviews-examples/user_guide/Gridded_Datasets_II.ipynb
  45. 2078 0
      datashader-work/geoviews-examples/user_guide/Projections.ipynb
  46. 406 0
      datashader-work/geoviews-examples/user_guide/Resampling_Grids.ipynb
  47. 220 0
      datashader-work/geoviews-examples/user_guide/Working_with_Bokeh.ipynb

File diff suppressed because it is too large
+ 684 - 0
datashader-work/datashader-tryout.ipynb


File diff suppressed because it is too large
+ 4599 - 0
datashader-work/geo-views.ipynb


File diff suppressed because it is too large
+ 94 - 0
datashader-work/geoviews-examples/Homepage.ipynb


BIN
datashader-work/geoviews-examples/assets/boundaries/boundaries.dbf


BIN
datashader-work/geoviews-examples/assets/boundaries/boundaries.shp


BIN
datashader-work/geoviews-examples/assets/boundaries/boundaries.shx


File diff suppressed because it is too large
+ 10031 - 0
datashader-work/geoviews-examples/assets/cities.csv


+ 400 - 0
datashader-work/geoviews-examples/assets/referendum.csv

@@ -0,0 +1,400 @@
+leaveVoteshare,regionName,turnout,name,code
+4.09999990463,Gibraltar,83.5,Gibraltar,BS0005003
+69.5999984741,North East,65.5,Hartlepool,E06000001
+65.5,North East,64.9000015259,Middlesbrough,E06000002
+66.1999969482,North East,70.1999969482,Redcar and Cleveland,E06000003
+61.7000007629,North East,71.0,Stockton-on-Tees,E06000004
+56.2000007629,North East,71.0,Darlington,E06000005
+57.4000015259,North West,68.1999969482,Halton,E06000006
+54.2999992371,North West,73.3000030518,Warrington,E06000007
+56.2999992371,North West,65.1999969482,Blackburn with Darwen,E06000008
+67.5,North West,65.4000015259,Blackpool,E06000009
+67.5999984741,Yorkshire and The Humber,62.9000015259,Kingston upon Hull,E06000010
+60.4000015259,Yorkshire and The Humber,74.8000030518,East Riding of Yorkshire,E06000011
+69.9000015259,Yorkshire and The Humber,67.9000015259,North East Lincolnshire,E06000012
+66.3000030518,Yorkshire and The Humber,71.9000015259,North Lincolnshire,E06000013
+42.0,Yorkshire and The Humber,70.5999984741,York,E06000014
+57.2000007629,East Midlands,70.5,Derby,E06000015
+48.9000015259,East Midlands,65.0,Leicester,E06000016
+50.5999984741,East Midlands,78.0999984741,Rutland,E06000017
+50.7999992371,East Midlands,61.7999992371,Nottingham,E06000018
+59.2000007629,West Midlands,78.3000030518,Herefordshire,E06000019
+63.2000007629,West Midlands,72.0999984741,Telford and Wrekin,E06000020
+69.4000015259,West Midlands,65.6999969482,Stoke-on-Trent,E06000021
+42.0999984741,South West,77.0999984741,Bath and North East Somerset,E06000022
+38.2999992371,South West,73.0999984741,Bristol,E06000023
+52.2000007629,South West,77.4000015259,North Somerset,E06000024
+52.7000007629,South West,76.1999969482,South Gloucestershire,E06000025
+59.9000015259,South West,71.4000015259,Plymouth,E06000026
+63.2000007629,South West,73.5999984741,Torbay,E06000027
+54.9000015259,South West,69.1999969482,Bournemouth,E06000028
+58.2000007629,South West,75.3000030518,Poole,E06000029
+54.7000007629,South West,75.8000030518,Swindon,E06000030
+60.9000015259,East,72.3000030518,Peterborough,E06000031
+56.5,East,66.1999969482,Luton,E06000032
+58.0999984741,East,72.8000030518,Southend-on-Sea,E06000033
+72.3000030518,East,72.6999969482,Thurrock,E06000034
+64.0999984741,South East,72.0999984741,Medway,E06000035
+53.9000015259,South East,76.0999984741,Bracknell Forest,E06000036
+48.2000007629,South East,79.9000015259,West Berkshire,E06000037
+42.0,South East,72.5,Reading,E06000038
+54.2999992371,South East,62.0999984741,Slough,E06000039
+46.0999984741,South East,79.6999969482,Royal Borough of Windsor and Maidenhead,E06000040
+43.2999992371,South East,80.0,Wokingham,E06000041
+51.4000015259,South East,73.5999984741,Milton Keynes,E06000042
+31.3999996185,South East,74.0,Brighton and Hove,E06000043
+58.0999984741,South East,70.3000030518,Portsmouth,E06000044
+53.7999992371,South East,68.0999984741,Southampton,E06000045
+61.9000015259,South East,72.3000030518,Isle of Wight,E06000046
+57.5,North East,68.6999969482,Durham,E06000047
+51.2000007629,North West,77.3000030518,Cheshire East,E06000049
+50.7000007629,North West,74.5,Cheshire West and Chester,E06000050
+56.9000015259,West Midlands,77.3000030518,Shropshire,E06000051
+56.5,South West,77.0,Cornwall,E06000052
+43.5999984741,South West,79.1999969482,Isles of Scilly,E06000053
+52.5,South West,78.8000030518,Wiltshire,E06000054
+51.7999992371,East,72.0,Bedford,E06000055
+56.0999984741,East,77.8000030518,Central Bedfordshire,E06000056
+54.0999984741,North East,74.3000030518,Northumberland,E06000057
+50.5,South East,78.4000015259,Aylesbury Vale,E07000004
+45.0,South East,83.5,Chiltern,E07000005
+50.7000007629,South East,78.0,South Bucks,E07000006
+48.0,South East,75.6999969482,Wycombe,E07000007
+26.2000007629,East,72.1999969482,Cambridge,E07000008
+50.9000015259,East,77.0,East Cambridgeshire,E07000009
+71.4000015259,East,73.6999969482,Fenland,E07000010
+54.2000007629,East,77.8000030518,Huntingdonshire,E07000011
+39.7999992371,East,81.1999969482,South Cambridgeshire,E07000012
+58.5999984741,North West,72.9000015259,Allerdale,E07000026
+60.5999984741,North West,67.8000030518,Barrow-in-Furness,E07000027
+60.0999984741,North West,74.5,Carlisle,E07000028
+62.0,North West,70.0,Copeland,E07000029
+53.2999992371,North West,75.6999969482,Eden,E07000030
+47.0999984741,North West,79.6999969482,South Lakeland,E07000031
+60.2999992371,East Midlands,76.3000030518,Amber Valley,E07000032
+70.8000030518,East Midlands,72.3000030518,Bolsover,E07000033
+60.0,East Midlands,71.9000015259,Chesterfield,E07000034
+51.5999984741,East Midlands,81.9000015259,Derbyshire Dales,E07000035
+61.2000007629,East Midlands,76.0,Erewash,E07000036
+50.5,East Midlands,75.5999984741,High Peak,E07000037
+62.7999992371,East Midlands,75.1999969482,North East Derbyshire,E07000038
+60.4000015259,East Midlands,76.8000030518,South Derbyshire,E07000039
+54.0999984741,South West,78.9000015259,East Devon,E07000040
+44.7000007629,South West,73.8000030518,Exeter,E07000041
+53.2999992371,South West,79.3000030518,Mid Devon,E07000042
+57.0,South West,76.8000030518,North Devon,E07000043
+47.0999984741,South West,80.1999969482,South Hams,E07000044
+53.9000015259,South West,79.3000030518,Teignbridge,E07000045
+60.7999992371,South West,78.3000030518,Torridge,E07000046
+53.2000007629,South West,81.1999969482,West Devon,E07000047
+58.7999992371,South West,79.3000030518,Christchurch,E07000048
+57.5999984741,South West,81.3000030518,East Dorset,E07000049
+56.4000015259,South West,79.6999969482,North Dorset,E07000050
+59.0999984741,South West,78.9000015259,Purbeck,E07000051
+51.0,South West,79.4000015259,West Dorset,E07000052
+61.0,South West,75.8000030518,Weymouth and Portland,E07000053
+57.2999992371,South East,74.6999969482,Eastbourne,E07000061
+54.9000015259,South East,71.5999984741,Hastings,E07000062
+47.9000015259,South East,77.8000030518,Lewes,E07000063
+58.5,South East,79.3000030518,Rother,E07000064
+54.5,South East,80.0,Wealden,E07000065
+68.5999984741,East,73.8000030518,Basildon,E07000066
+61.0999984741,East,76.5999984741,Braintree,E07000067
+59.2000007629,East,79.5,Brentwood,E07000068
+72.6999969482,East,75.3000030518,Castle Point,E07000069
+52.7999992371,East,77.5999984741,Chelmsford,E07000070
+53.5999984741,East,75.0999984741,Colchester,E07000071
+62.7000007629,East,76.8000030518,Epping Forest,E07000072
+68.0999984741,East,73.5,Harlow,E07000073
+62.5999984741,East,79.0999984741,Maldon,E07000074
+66.5999984741,East,78.8000030518,Rochford,E07000075
+69.5,East,74.4000015259,Tendring,E07000076
+50.7000007629,East,80.1999969482,Uttlesford,E07000077
+43.7999992371,South West,75.8000030518,Cheltenham,E07000078
+48.9000015259,South West,79.8000030518,Cotswold,E07000079
+58.5999984741,South West,77.4000015259,Forest of Dean,E07000080
+58.5,South West,72.0,Gloucester,E07000081
+45.4000015259,South West,80.0,Stroud,E07000082
+53.2000007629,South West,79.0999984741,Tewkesbury,E07000083
+51.9000015259,South East,78.0,Basingstoke and Deane,E07000084
+49.5,South East,81.5999984741,East Hampshire,E07000085
+52.5,South East,78.1999969482,Eastleigh,E07000086
+55.0999984741,South East,79.5999984741,Fareham,E07000087
+63.9000015259,South East,73.5,Gosport,E07000088
+47.5999984741,South East,82.5999984741,Hart,E07000089
+62.4000015259,South East,74.0999984741,Havant,E07000090
+57.7999992371,South East,79.1999969482,New Forest,E07000091
+58.2000007629,South East,74.0999984741,Rushmoor,E07000092
+51.9000015259,South East,79.5999984741,Test Valley,E07000093
+41.0999984741,South East,81.1999969482,Winchester,E07000094
+66.3000030518,East,73.6999969482,Broxbourne,E07000095
+50.7000007629,East,79.0999984741,Dacorum,E07000096
+50.7999992371,East,76.5999984741,Hertsmere,E07000098
+45.5999984741,East,78.1999969482,North Hertfordshire,E07000099
+51.2999992371,East,78.4000015259,Three Rivers,E07000102
+50.2999992371,East,71.5999984741,Watford,E07000103
+59.4000015259,South East,77.0999984741,Ashford,E07000105
+51.0,South East,75.0,Canterbury,E07000106
+64.1999969482,South East,75.5,Dartford,E07000107
+62.2000007629,South East,76.5,Dover,E07000108
+65.4000015259,South East,74.9000015259,Gravesham,E07000109
+58.7999992371,South East,76.0,Maidstone,E07000110
+54.4000015259,South East,80.5999984741,Sevenoaks,E07000111
+62.2000007629,South East,74.9000015259,Shepway,E07000112
+62.5,South East,74.1999969482,Swale,E07000113
+63.7999992371,South East,72.8000030518,Thanet,E07000114
+55.7000007629,South East,79.5999984741,Tonbridge and Malling,E07000115
+45.0999984741,South East,79.0999984741,Tunbridge Wells,E07000116
+66.5999984741,North West,67.1999969482,Burnley,E07000117
+56.7999992371,North West,75.5,Chorley,E07000118
+57.0,North West,75.5,Fylde,E07000119
+66.1999969482,North West,64.6999969482,Hyndburn,E07000120
+51.0999984741,North West,72.5999984741,Lancaster,E07000121
+63.2000007629,North West,70.1999969482,Pendle,E07000122
+53.2999992371,North West,68.6999969482,Preston,E07000123
+56.4000015259,North West,79.0,Ribble Valley,E07000124
+60.7000007629,North West,72.4000015259,Rossendale,E07000125
+58.5999984741,North West,75.3000030518,South Ribble,E07000126
+55.2999992371,North West,74.4000015259,West Lancashire,E07000127
+63.7999992371,North West,74.5999984741,Wyre,E07000128
+59.5,East Midlands,76.5,Blaby,E07000129
+53.7999992371,East Midlands,70.4000015259,Charnwood,E07000130
+50.7000007629,East Midlands,81.4000015259,Harborough,E07000131
+60.2999992371,East Midlands,76.6999969482,Hinckley and Bosworth,E07000132
+58.0999984741,East Midlands,81.3000030518,Melton,E07000133
+60.7000007629,East Midlands,77.9000015259,North West Leicestershire,E07000134
+54.5999984741,East Midlands,73.6999969482,Oadby and Wigston,E07000135
+75.5999984741,East Midlands,77.1999969482,Boston,E07000136
+70.6999969482,East Midlands,74.9000015259,East Lindsey,E07000137
+56.9000015259,East Midlands,69.3000030518,Lincoln,E07000138
+62.2999992371,East Midlands,78.4000015259,North Kesteven,E07000139
+73.5999984741,East Midlands,75.3000030518,South Holland,E07000140
+59.9000015259,East Midlands,78.1999969482,South Kesteven,E07000141
+61.7999992371,East Midlands,74.5,West Lindsey,E07000142
+64.1999969482,East,74.3000030518,Breckland,E07000143
+54.4000015259,East,78.3000030518,Broadland,E07000144
+71.5,East,69.0,Great Yarmouth,E07000145
+66.4000015259,East,74.6999969482,King's Lynn and West Norfolk,E07000146
+58.9000015259,East,76.8000030518,North Norfolk,E07000147
+43.7999992371,East,69.0999984741,Norwich,E07000148
+51.7000007629,East,78.5,South Norfolk,E07000149
+64.1999969482,East Midlands,74.0999984741,Corby,E07000150
+58.5999984741,East Midlands,80.9000015259,Daventry,E07000151
+58.7999992371,East Midlands,76.9000015259,East Northamptonshire,E07000152
+61.0,East Midlands,76.4000015259,Kettering,E07000153
+58.4000015259,East Midlands,72.5999984741,Northampton,E07000154
+54.2999992371,East Midlands,79.4000015259,South Northamptonshire,E07000155
+62.4000015259,East Midlands,75.4000015259,Wellingborough,E07000156
+52.7999992371,Yorkshire and The Humber,81.0,Craven,E07000163
+53.7000007629,Yorkshire and The Humber,78.4000015259,Hambleton,E07000164
+49.0,Yorkshire and The Humber,78.8000030518,Harrogate,E07000165
+56.7999992371,Yorkshire and The Humber,75.0999984741,Richmondshire,E07000166
+55.2999992371,Yorkshire and The Humber,77.1999969482,Ryedale,E07000167
+62.0,Yorkshire and The Humber,73.0,Scarborough,E07000168
+59.2000007629,Yorkshire and The Humber,79.0999984741,Selby,E07000169
+69.8000030518,East Midlands,72.8000030518,Ashfield,E07000170
+67.8000030518,East Midlands,74.8000030518,Bassetlaw,E07000171
+54.5999984741,East Midlands,78.3000030518,Broxtowe,E07000172
+55.5999984741,East Midlands,76.5,Gedling,E07000173
+70.9000015259,East Midlands,72.5999984741,Mansfield,E07000174
+60.4000015259,East Midlands,76.8000030518,Newark and Sherwood,E07000175
+42.4000015259,East Midlands,81.5,Rushcliffe,E07000176
+50.2999992371,South East,75.5,Cherwell,E07000177
+29.7000007629,South East,72.3000030518,Oxford,E07000178
+45.0,South East,80.6999969482,South Oxfordshire,E07000179
+43.2999992371,South East,81.0999984741,Vale of White Horse,E07000180
+46.2999992371,South East,79.6999969482,West Oxfordshire,E07000181
+48.9000015259,South West,76.9000015259,Mendip,E07000187
+61.2000007629,South West,76.3000030518,Sedgemoor,E07000188
+57.2000007629,South West,78.5999984741,South Somerset,E07000189
+52.9000015259,South West,78.0999984741,Taunton Deane,E07000190
+60.5999984741,South West,79.0999984741,West Somerset,E07000191
+68.9000015259,West Midlands,71.4000015259,Cannock Chase,E07000192
+63.2000007629,West Midlands,74.3000030518,East Staffordshire,E07000193
+58.7999992371,West Midlands,78.6999969482,Lichfield,E07000194
+63.0,West Midlands,74.3000030518,Newcastle-under-Lyme,E07000195
+64.8000030518,West Midlands,77.8000030518,South Staffordshire,E07000196
+56.0,West Midlands,77.8000030518,Stafford,E07000197
+64.6999969482,West Midlands,75.3000030518,Staffordshire Moorlands,E07000198
+67.5,West Midlands,74.0999984741,Tamworth,E07000199
+54.2000007629,East,78.1999969482,Babergh,E07000200
+65.0,East,72.5,Forest Heath,E07000201
+58.2999992371,East,72.5,Ipswich,E07000202
+55.2000007629,East,78.0999984741,Mid Suffolk,E07000203
+56.5999984741,East,76.6999969482,St Edmundsbury,E07000204
+53.0,East,80.5999984741,Suffolk Coastal,E07000205
+62.9000015259,East,72.5999984741,Waveney,E07000206
+40.5,South East,78.0999984741,Elmbridge,E07000207
+47.9000015259,South East,80.4000015259,Epsom and Ewell,E07000208
+43.7999992371,South East,76.9000015259,Guildford,E07000209
+46.9000015259,South East,82.0999984741,Mole Valley,E07000210
+50.5,South East,78.1999969482,Reigate and Banstead,E07000211
+54.2999992371,South East,76.0,Runnymede,E07000212
+60.2999992371,South East,77.9000015259,Spelthorne,E07000213
+51.0,South East,79.8000030518,Surrey Heath,E07000214
+52.7999992371,South East,80.3000030518,Tandridge,E07000215
+41.5999984741,South East,82.3000030518,Waverley,E07000216
+43.7999992371,South East,77.4000015259,Woking,E07000217
+66.9000015259,West Midlands,76.1999969482,North Warwickshire,E07000218
+66.0,West Midlands,74.3000030518,Nuneaton and Bedworth,E07000219
+56.7000007629,West Midlands,79.0,Rugby,E07000220
+51.5999984741,West Midlands,80.8000030518,Stratford-on-Avon,E07000221
+41.2000007629,West Midlands,79.1999969482,Warwick,E07000222
+54.5999984741,South East,76.4000015259,Adur,E07000223
+62.5,South East,77.8000030518,Arun,E07000224
+50.9000015259,South East,77.8000030518,Chichester,E07000225
+58.4000015259,South East,73.1999969482,Crawley,E07000226
+48.5,South East,81.5999984741,Horsham,E07000227
+46.9000015259,South East,80.6999969482,Mid Sussex,E07000228
+53.0,South East,75.4000015259,Worthing,E07000229
+55.4000015259,West Midlands,79.3000030518,Bromsgrove,E07000234
+52.2000007629,West Midlands,80.5,Malvern Hills,E07000235
+62.2999992371,West Midlands,75.1999969482,Redditch,E07000236
+53.7000007629,West Midlands,73.8000030518,Worcester,E07000237
+57.9000015259,West Midlands,80.8000030518,Wychavon,E07000238
+63.0999984741,West Midlands,74.0,Wyre Forest,E07000239
+37.2999992371,East,82.4000015259,St Albans,E07000240
+53.0,East,75.0,Welwyn Hatfield,E07000241
+50.4000015259,East,80.3000030518,East Hertfordshire,E07000242
+59.2000007629,East,73.6999969482,Stevenage,E07000243
+58.2999992371,North West,70.0999984741,Bolton,E08000001
+54.0999984741,North West,71.3000030518,Bury,E08000002
+39.5999984741,North West,59.7000007629,Manchester,E08000003
+60.9000015259,North West,67.9000015259,Oldham,E08000004
+60.0999984741,North West,65.9000015259,Rochdale,E08000005
+56.7999992371,North West,63.2000007629,Salford,E08000006
+47.7000007629,North West,73.9000015259,Stockport,E08000007
+61.0999984741,North West,66.0,Tameside,E08000008
+42.2999992371,North West,75.8000030518,Trafford,E08000009
+63.9000015259,North West,69.1999969482,Wigan,E08000010
+51.5999984741,North West,63.5,Knowsley,E08000011
+41.7999992371,North West,64.0,Liverpool,E08000012
+58.0,North West,68.8000030518,St Helens,E08000013
+48.0999984741,North West,71.6999969482,Sefton,E08000014
+48.2999992371,North West,70.9000015259,Wirral,E08000015
+68.3000030518,Yorkshire and The Humber,69.9000015259,Barnsley,E08000016
+69.0,Yorkshire and The Humber,69.5,Doncaster,E08000017
+67.9000015259,Yorkshire and The Humber,69.5,Rotherham,E08000018
+51.0,Yorkshire and The Humber,67.3000030518,Sheffield,E08000019
+49.2999992371,North East,67.5999984741,Newcastle upon Tyne,E08000021
+53.4000015259,North East,72.3000030518,North Tyneside,E08000022
+62.0,North East,68.1999969482,South Tyneside,E08000023
+61.2999992371,North East,64.8000030518,Sunderland,E08000024
+50.4000015259,West Midlands,63.7000007629,Birmingham,E08000025
+55.5999984741,West Midlands,69.0999984741,Coventry,E08000026
+67.5999984741,West Midlands,71.6999969482,Dudley,E08000027
+66.6999969482,West Midlands,66.5,Sandwell,E08000028
+56.2000007629,West Midlands,76.0,Solihull,E08000029
+67.9000015259,West Midlands,69.5999984741,Walsall,E08000030
+62.5999984741,West Midlands,67.5,Wolverhampton,E08000031
+54.2000007629,Yorkshire and The Humber,66.6999969482,Bradford,E08000032
+55.7000007629,Yorkshire and The Humber,71.0,Calderdale,E08000033
+54.7000007629,Yorkshire and The Humber,70.6999969482,Kirklees,E08000034
+49.7000007629,Yorkshire and The Humber,71.3000030518,Leeds,E08000035
+66.4000015259,Yorkshire and The Humber,71.0999984741,Wakefield,E08000036
+56.7999992371,North East,70.5999984741,Gateshead,E08000037
+24.7000007629,London,73.5,City of London,E09000001
+62.4000015259,London,63.7999992371,Barking and Dagenham,E09000002
+37.7999992371,London,72.0999984741,Barnet,E09000003
+63.0,London,75.1999969482,Bexley,E09000004
+40.2999992371,London,65.0,Brent,E09000005
+49.4000015259,London,78.8000030518,Bromley,E09000006
+25.1000003815,London,65.4000015259,Camden,E09000007
+45.7000007629,London,69.8000030518,Croydon,E09000008
+39.5999984741,London,70.0,Ealing,E09000009
+44.2000007629,London,69.0,Enfield,E09000010
+44.4000015259,London,69.5,Greenwich,E09000011
+21.5,London,65.0999984741,Hackney,E09000012
+30.0,London,69.9000015259,Hammersmith and Fulham,E09000013
+24.3999996185,London,70.5,Haringey,E09000014
+45.4000015259,London,72.1999969482,Harrow,E09000015
+69.6999969482,London,76.0,Havering,E09000016
+56.4000015259,London,68.9000015259,Hillingdon,E09000017
+48.9000015259,London,69.6999969482,Hounslow,E09000018
+24.7999992371,London,70.3000030518,Islington,E09000019
+31.2999992371,London,65.9000015259,Kensington and Chelsea,E09000020
+38.4000015259,London,78.3000030518,Kingston upon Thames,E09000021
+21.3999996185,London,67.3000030518,Lambeth,E09000022
+30.1000003815,London,63.0,Lewisham,E09000023
+37.0999984741,London,73.4000015259,Merton,E09000024
+47.2000007629,London,59.2000007629,Newham,E09000025
+46.0,London,67.5,Redbridge,E09000026
+30.7000007629,London,82.0,Richmond upon Thames,E09000027
+27.2000007629,London,66.0999984741,Southwark,E09000028
+53.7000007629,London,76.0,Sutton,E09000029
+32.5,London,64.5,Tower Hamlets,E09000030
+40.9000015259,London,66.5999984741,Waltham Forest,E09000031
+25.0,London,71.9000015259,Wandsworth,E09000032
+31.0,London,64.9000015259,Westminster,E09000033
+51.4000015259,Northern Ireland,66.5,Belfast East,N06000001
+49.5999984741,Northern Ireland,57.5,Belfast North,N06000002
+30.5,Northern Ireland,67.5999984741,Belfast South,N06000003
+25.8999996185,Northern Ireland,48.9000015259,Belfast West,N06000004
+55.2000007629,Northern Ireland,65.1999969482,East Antrim,N06000005
+48.0,Northern Ireland,59.9000015259,East Londonderry,N06000006
+41.4000015259,Northern Ireland,67.9000015259,Fermanagh and South Tyrone,N06000007
+21.7000007629,Northern Ireland,57.4000015259,Foyle,N06000008
+53.0999984741,Northern Ireland,66.5999984741,Lagan Valley,N06000009
+39.5999984741,Northern Ireland,61.7000007629,Mid Ulster,N06000010
+37.0999984741,Northern Ireland,63.7000007629,Newry and Armagh,N06000011
+62.2000007629,Northern Ireland,64.9000015259,North Antrim,N06000012
+47.5999984741,Northern Ireland,67.6999969482,North Down,N06000013
+50.5999984741,Northern Ireland,63.4000015259,South Antrim,N06000014
+32.7999992371,Northern Ireland,62.4000015259,South Down,N06000015
+55.5,Northern Ireland,64.5,Strangford,N06000016
+52.5999984741,Northern Ireland,63.7999992371,Upper Bann,N06000017
+33.2000007629,Northern Ireland,61.7999992371,West Tyrone,N06000018
+42.2000007629,Scotland,67.1999969482,Clackmannanshire,S12000005
+46.9000015259,Scotland,71.4000015259,Dumfries and Galloway,S12000006
+41.4000015259,Scotland,62.9000015259,East Ayrshire,S12000008
+35.4000015259,Scotland,71.6999969482,East Lothian,S12000010
+25.7000007629,Scotland,76.0999984741,East Renfrewshire,S12000011
+44.7999992371,Scotland,70.0999984741,Eilean Siar,S12000013
+43.2000007629,Scotland,67.5,Falkirk,S12000014
+41.4000015259,Scotland,66.6999969482,Fife,S12000015
+44.0,Scotland,71.5999984741,Highland,S12000017
+36.2000007629,Scotland,66.0,Inverclyde,S12000018
+37.9000015259,Scotland,68.0999984741,Midlothian,S12000019
+49.9000015259,Scotland,67.4000015259,Moray,S12000020
+43.0999984741,Scotland,64.5999984741,North Ayrshire,S12000021
+36.7999992371,Scotland,68.3000030518,Orkney Islands,S12000023
+38.9000015259,Scotland,73.6999969482,Perth and Kinross,S12000024
+41.5,Scotland,73.4000015259,Scottish Borders,S12000026
+43.5,Scotland,70.3000030518,Shetland Islands,S12000027
+41.0,Scotland,69.8000030518,South Ayrshire,S12000028
+36.9000015259,Scotland,65.3000030518,South Lanarkshire,S12000029
+32.2999992371,Scotland,74.0,Stirling,S12000030
+38.9000015259,Scotland,67.9000015259,Aberdeen City,S12000033
+45.0,Scotland,70.5999984741,Aberdeenshire,S12000034
+39.4000015259,Scotland,73.0999984741,Argyll and Bute,S12000035
+25.6000003815,Scotland,72.9000015259,"Edinburgh, City of",S12000036
+35.2000007629,Scotland,69.1999969482,Renfrewshire,S12000038
+38.0,Scotland,63.9000015259,West Dunbartonshire,S12000039
+41.7000007629,Scotland,67.5999984741,West Lothian,S12000040
+44.7000007629,Scotland,68.0,Angus,S12000041
+40.2000007629,Scotland,62.9000015259,Dundee City,S12000042
+38.2999992371,Scotland,60.9000015259,North Lanarkshire,S12000044
+28.6000003815,Scotland,75.0999984741,East Dunbartonshire,S12000045
+33.4000015259,Scotland,56.2000007629,Glasgow City,S12000046
+50.9000015259,Wales,73.8000030518,Isle of Anglesey,W06000001
+41.9000015259,Wales,72.3000030518,Gwynedd,W06000002
+54.0,Wales,71.6999969482,Conwy,W06000003
+54.0,Wales,69.0999984741,Denbighshire,W06000004
+56.4000015259,Wales,74.8000030518,Flintshire,W06000005
+59.0,Wales,71.5,Wrexham,W06000006
+45.4000015259,Wales,74.4000015259,Ceredigion,W06000008
+57.0999984741,Wales,74.4000015259,Pembrokeshire,W06000009
+53.7000007629,Wales,74.0,Carmarthenshire,W06000010
+51.5,Wales,69.5,Swansea,W06000011
+56.7999992371,Wales,71.5,Neath Port Talbot,W06000012
+54.5999984741,Wales,71.0999984741,Bridgend,W06000013
+49.2999992371,Wales,76.0999984741,The Vale of Glamorgan,W06000014
+40.0,Wales,69.5999984741,Cardiff,W06000015
+53.7000007629,Wales,67.4000015259,Rhondda Cynon Taf,W06000016
+57.5999984741,Wales,70.6999969482,Caerphilly,W06000018
+62.0,Wales,68.0999984741,Blaenau Gwent,W06000019
+59.7999992371,Wales,69.8000030518,Torfaen,W06000020
+49.5999984741,Wales,77.6999969482,Monmouthshire,W06000021
+56.0,Wales,70.1999969482,Newport,W06000022
+53.7000007629,Wales,77.0,Powys,W06000023
+56.4000015259,Wales,67.4000015259,Merthyr Tydfil,W06000024

File diff suppressed because it is too large
+ 1 - 0
datashader-work/geoviews-examples/assets/results.json


BIN
datashader-work/geoviews-examples/data/ensemble.nc


BIN
datashader-work/geoviews-examples/data/ensembles.nc


BIN
datashader-work/geoviews-examples/data/pre-industrial.nc


+ 10 - 0
datashader-work/geoviews-examples/datasets.yml

@@ -0,0 +1,10 @@
+---
+
+data:
+
+  - url: 'http://assets.holoviews.org/geoviews-sample-data.zip'
+    title: 'GeoViews sample data'
+    files:
+      - ensemble.nc
+      - ensembles.nc
+      - pre-industrial.nc

+ 90 - 0
datashader-work/geoviews-examples/gallery/bokeh/airport_graph.ipynb

@@ -0,0 +1,90 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geoviews as gv\n",
+    "\n",
+    "from geoviews import opts\n",
+    "from bokeh.sampledata.airport_routes import airports, routes\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# Count the number of connections from each airport\n",
+    "counts = routes.groupby('SourceID')[['Stops']].count().reset_index().rename(columns={'Stops': 'Connections'})\n",
+    "airports_df = pd.merge(airports, counts, left_on='AirportID', right_on='SourceID', how='left')\n",
+    "\n",
+    "# Select only US mainland airports & convert from Mercator to Latitudes/Longitudes\n",
+    "airport_points = gv.Points(airports_df, ['Longitude', 'Latitude']).select(Longitude=(-170, -50), Latitude=(0, 50))\n",
+    "\n",
+    "# Declare nodes, graph and tiles\n",
+    "nodes = gv.Nodes(airport_points, ['Longitude', 'Latitude', 'AirportID'],\n",
+    "                 ['Name', 'City', 'Connections'])\n",
+    "graph = gv.Graph((routes, nodes), ['SourceID', 'DestinationID'], ['Source', 'Destination'])\n",
+    "tiles = gv.tile_sources.Wikipedia\n",
+    "\n",
+    "# Select 50 busiest airports\n",
+    "busiest = list(routes.groupby('SourceID').count().sort_values('Stops').iloc[-50:].index.values)\n",
+    "busiest_airports = graph.select(AirportID=busiest, selection_mode='nodes')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "(tiles * busiest_airports).opts(\n",
+    "    opts.Graph(edge_selection_line_color='black', edge_hover_line_color='red',\n",
+    "               edge_line_width=1, edge_line_alpha=0.01, edge_nonselection_line_alpha=0.01,\n",
+    "               padding=0.1, width=800, height=600))"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 74 - 0
datashader-work/geoviews-examples/gallery/bokeh/brexit_choropleth.ipynb

@@ -0,0 +1,74 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geopandas as gpd\n",
+    "import geoviews as gv\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Declaring data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "geometries = gpd.read_file('../../assets/boundaries/boundaries.shp')\n",
+    "referendum = pd.read_csv('../../assets/referendum.csv')\n",
+    "gdf = gpd.GeoDataFrame(pd.merge(geometries, referendum))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gv.Polygons(gdf, vdims=['name', 'leaveVoteshare'], label='Brexit Referendum Vote').opts(\n",
+    "    tools=['hover'], width=550, height=700, color_index='leaveVoteshare',\n",
+    "    colorbar=True, toolbar='above', xaxis=None, yaxis=None, padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 80 - 0
datashader-work/geoviews-examples/gallery/bokeh/city_populations_2050.ipynb

@@ -0,0 +1,80 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geoviews as gv\n",
+    "import geoviews.tile_sources as gvts\n",
+    "\n",
+    "from geoviews import dim\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Declare data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "cities = pd.read_csv('../../assets/cities.csv', encoding=\"ISO-8859-1\")\n",
+    "\n",
+    "points = gv.Points(cities, ['Longitude', 'Latitude'], ['City', 'Population', 'Country', 'Year'],\n",
+    "                   label='Top 20 Cities by population in 2050').select(Year=2050).sort('Population').iloc[-20:]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "(gvts.CartoMidnight *\n",
+    " points.opts(\n",
+    "    size=gv.dim('Population')*0.000002, fill_color='Population', line_color='gray', cmap='viridis',\n",
+    "    width=700, height=600, global_extent=True, tools=['hover'], show_legend=False) *\n",
+    " gv.Labels(points).opts(\n",
+    "    text_font_size='8pt', text_color='white'))"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 93 - 0
datashader-work/geoviews-examples/gallery/bokeh/filled_contours.ipynb

@@ -0,0 +1,93 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import holoviews as hv\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "\n",
+    "from cartopy import crs\n",
+    "from geoviews import opts\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def sample_data(shape=(73, 145)):\n",
+    "    \"\"\"Returns ``lons``, ``lats`` and ``data`` of some fake data.\"\"\"\n",
+    "    nlats, nlons = shape\n",
+    "    ys = np.linspace(-np.pi / 2, np.pi / 2, nlats)\n",
+    "    xs = np.linspace(0, 2*np.pi, nlons)\n",
+    "    lons, lats = np.meshgrid(xs, ys)\n",
+    "    wave = 0.75 * (np.sin(2 * lats) ** 8) * np.cos(4 * lons)\n",
+    "    mean = 0.5 * np.cos(2 * lats) * ((np.sin(2 * lats)) ** 2 + 2)\n",
+    "\n",
+    "    lats = np.rad2deg(ys)\n",
+    "    lons = np.rad2deg(xs)\n",
+    "    data = wave + mean\n",
+    "\n",
+    "    return lons, lats, data\n",
+    "\n",
+    "lons, lats, data = sample_data()\n",
+    "\n",
+    "# Make sure we declare the central longitude\n",
+    "contours = gv.FilledContours((lons, lats, data), crs=crs.PlateCarree(central_longitude=180))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "(contours * gf.coastline).opts(\n",
+    "    opts.FilledContours(levels=8, color_levels=10, cmap='nipy_spectral', colorbar=True, width=600, height=300, projection=crs.Mollweide()))"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 92 - 0
datashader-work/geoviews-examples/gallery/bokeh/great_circle.ipynb

@@ -0,0 +1,92 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pyproj\n",
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "from bokeh.sampledata.airport_routes import airports, routes\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def get_circle_path(start, end, samples=200):\n",
+    "    sx, sy = start\n",
+    "    ex, ey = end\n",
+    "    g = pyproj.Geod(ellps='WGS84')\n",
+    "    (az12, az21, dist) = g.inv(sx, sy, ex, ey)\n",
+    "    lonlats = g.npts(sx, sy, ex, ey, samples)\n",
+    "    return np.array([(sx, sy)]+lonlats+[(ex, ey)])\n",
+    "\n",
+    "# Compute great-circle paths for all US flight routes from Honolulu\n",
+    "paths = []\n",
+    "honolulu = (-157.9219970703125, 21.318700790405273)\n",
+    "routes = routes[routes.SourceID==3728]\n",
+    "airports = airports[airports.AirportID.isin(list(routes.DestinationID)+[3728])]\n",
+    "for i, route in routes.iterrows():\n",
+    "    airport = airports[airports.AirportID==route.DestinationID].iloc[0]\n",
+    "    paths.append(get_circle_path(honolulu, (airport.Longitude, airport.Latitude)))\n",
+    "tiles = gv.tile_sources.Wikipedia\n",
+    "\n",
+    "# Define Graph from Nodes and EdgePaths\n",
+    "path = gv.EdgePaths(paths)\n",
+    "points = gv.Nodes(airports, ['Longitude', 'Latitude', 'AirportID'], ['Name', 'City'])\n",
+    "graph = gv.Graph((routes, points, path), ['SourceID', 'DestinationID'])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles * graph.opts(width=600, height=400, tools=['hover', 'tap'], node_color='black', padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 119 - 0
datashader-work/geoviews-examples/gallery/bokeh/katrina_track.ipynb

@@ -0,0 +1,119 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geoviews as gv\n",
+    "import cartopy.io.shapereader as shpreader\n",
+    "import shapely.geometry as sgeom\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def sample_data():\n",
+    "    \"\"\"\n",
+    "    Returns a list of latitudes and a list of longitudes (lons, lats)\n",
+    "    for Hurricane Katrina (2005).\n",
+    "\n",
+    "    The data was originally sourced from the HURDAT2 dataset from AOML/NOAA:\n",
+    "    http://www.aoml.noaa.gov/hrd/hurdat/newhurdat-all.html on 14th Dec 2012.\n",
+    "\n",
+    "    \"\"\"\n",
+    "    lons = [-75.1, -75.7, -76.2, -76.5, -76.9, -77.7, -78.4, -79.0,\n",
+    "            -79.6, -80.1, -80.3, -81.3, -82.0, -82.6, -83.3, -84.0,\n",
+    "            -84.7, -85.3, -85.9, -86.7, -87.7, -88.6, -89.2, -89.6,\n",
+    "            -89.6, -89.6, -89.6, -89.6, -89.1, -88.6, -88.0, -87.0,\n",
+    "            -85.3, -82.9]\n",
+    "\n",
+    "    lats = [23.1, 23.4, 23.8, 24.5, 25.4, 26.0, 26.1, 26.2, 26.2, 26.0,\n",
+    "            25.9, 25.4, 25.1, 24.9, 24.6, 24.4, 24.4, 24.5, 24.8, 25.2,\n",
+    "            25.7, 26.3, 27.2, 28.2, 29.3, 29.5, 30.2, 31.1, 32.6, 34.1,\n",
+    "            35.6, 37.0, 38.6, 40.1]\n",
+    "\n",
+    "    return lons, lats\n",
+    "\n",
+    "shapename = 'admin_1_states_provinces_lakes_shp'\n",
+    "states_shp = shpreader.natural_earth(resolution='110m',\n",
+    "                                     category='cultural', name=shapename)\n",
+    "\n",
+    "lons, lats = sample_data()\n",
+    "track = sgeom.LineString(zip(lons, lats))\n",
+    "\n",
+    "title = 'US States which intersect the track of Hurricane Katrina (2005)'\n",
+    "\n",
+    "track_buffer = track.buffer(2)\n",
+    "shapes = []\n",
+    "for state in shpreader.Reader(states_shp).geometries():\n",
+    "    # pick a default color for the land with a black outline,\n",
+    "    # this will change if the storm intersects with our track\n",
+    "    facecolor = (0.9375, 0.9375, 0.859375)\n",
+    "\n",
+    "    if state.intersects(track):\n",
+    "        facecolor = 'red'\n",
+    "    elif state.intersects(track_buffer):\n",
+    "        facecolor = '#FF7E00'\n",
+    "    shapes.append(gv.Shape(state).opts(style=dict(fill_color=facecolor)))\n",
+    "shapes.append(gv.Shape(track_buffer).opts(style=dict(alpha=0.5)))\n",
+    "shapes.append(gv.Shape(track))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# Add proxy artists for legend\n",
+    "popts = dict(show_legend=True, apply_ranges=False)\n",
+    "direct_hit = gv.Polygons([[(0,0)]], label='State directly intersects with track').opts(color='red', **popts)\n",
+    "within_2_deg = gv.Polygons([[(0,0)]], label='State is within 2 degrees of track').opts(color='#FF7E00', **popts)\n",
+    "\n",
+    "(gv.Overlay(shapes) * direct_hit * within_2_deg).opts(width=700, height=500, infer_projection=True, title=title)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 63 - 0
datashader-work/geoviews-examples/gallery/bokeh/new_york_boroughs.ipynb

@@ -0,0 +1,63 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geopandas as gpd\n",
+    "import geoviews as gv\n",
+    "import cartopy.crs as ccrs\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles = gv.tile_sources.Wikipedia\n",
+    "\n",
+    "# Project data to Web Mercator\n",
+    "nybb = gpd.read_file(gpd.datasets.get_path('nybb'))\n",
+    "poly_data = nybb.to_crs(ccrs.GOOGLE_MERCATOR.proj4_init)\n",
+    "polys = gv.Polygons(poly_data, vdims=['BoroName'], crs=ccrs.GOOGLE_MERCATOR)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles * polys.opts(color='BoroName', cmap='Category20', width=800, height=600, tools=['hover', 'tap'])"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 95 - 0
datashader-work/geoviews-examples/gallery/bokeh/orthographic_vectorfield.ipynb

@@ -0,0 +1,95 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "import cartopy.crs as ccrs\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Declare data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def sample_data(shape=(20, 30)):\n",
+    "    \"\"\"\n",
+    "    Returns ``(x, y, u, v, crs)`` of some vector data\n",
+    "    computed mathematically. The returned crs will be a rotated\n",
+    "    pole CRS, meaning that the vectors will be unevenly spaced in\n",
+    "    regular PlateCarree space.\n",
+    "\n",
+    "    \"\"\"\n",
+    "    crs = ccrs.RotatedPole(pole_longitude=177.5, pole_latitude=37.5)\n",
+    "\n",
+    "    x = np.linspace(311.9, 391.1, shape[1])\n",
+    "    y = np.linspace(-23.6, 24.8, shape[0])\n",
+    "\n",
+    "    x2d, y2d = np.meshgrid(x, y)\n",
+    "    u = 10 * (2 * np.cos(2 * np.deg2rad(x2d) + 3 * np.deg2rad(y2d + 30)) ** 2)\n",
+    "    v = 20 * np.cos(6 * np.deg2rad(x2d))\n",
+    "\n",
+    "    return x, y, u, v, crs\n",
+    "\n",
+    "xs, ys, U, V, crs = sample_data()\n",
+    "mag = np.sqrt(U**2 + V**2)\n",
+    "angle = (np.pi/2.) - np.arctan2(U/mag, V/mag)\n",
+    "vectorfield = gv.VectorField((xs, ys, angle, mag), crs=crs)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gf.ocean * gf.coastline * gf.land * vectorfield.opts(\n",
+    "    magnitude='Magnitude', width=500, height=500,\n",
+    "    projection=ccrs.Orthographic(-10, 45), global_extent=True)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 58 - 0
datashader-work/geoviews-examples/gallery/bokeh/tile_sources.ipynb

@@ -0,0 +1,58 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geoviews as gv\n",
+    "\n",
+    "from geoviews import opts, tile_sources as gvts\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "opts.defaults(\n",
+    "    opts.WMTS(width=200, height=200, xaxis=None, yaxis=None, level='annotation'))\n",
+    "\n",
+    "(gvts.OSM + gvts.Wikipedia + gvts.StamenToner + gvts.EsriNatGeo +\n",
+    " gvts.EsriImagery + gvts.EsriUSATopo + gvts.EsriTerrain + gvts.EsriReference).cols(4)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 115 - 0
datashader-work/geoviews-examples/gallery/bokeh/trimesh_uk.ipynb

@@ -0,0 +1,115 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "import cartopy.crs as ccrs\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# Some points defining a triangulation over (roughly) Britain.\n",
+    "xy = np.asarray([\n",
+    "    [-0.101, 0.872], [-0.080, 0.883], [-0.069, 0.888], [-0.054, 0.890],\n",
+    "    [-0.045, 0.897], [-0.057, 0.895], [-0.073, 0.900], [-0.087, 0.898],\n",
+    "    [-0.090, 0.904], [-0.069, 0.907], [-0.069, 0.921], [-0.080, 0.919],\n",
+    "    [-0.073, 0.928], [-0.052, 0.930], [-0.048, 0.942], [-0.062, 0.949],\n",
+    "    [-0.054, 0.958], [-0.069, 0.954], [-0.087, 0.952], [-0.087, 0.959],\n",
+    "    [-0.080, 0.966], [-0.085, 0.973], [-0.087, 0.965], [-0.097, 0.965],\n",
+    "    [-0.097, 0.975], [-0.092, 0.984], [-0.101, 0.980], [-0.108, 0.980],\n",
+    "    [-0.104, 0.987], [-0.102, 0.993], [-0.115, 1.001], [-0.099, 0.996],\n",
+    "    [-0.101, 1.007], [-0.090, 1.010], [-0.087, 1.021], [-0.069, 1.021],\n",
+    "    [-0.052, 1.022], [-0.052, 1.017], [-0.069, 1.010], [-0.064, 1.005],\n",
+    "    [-0.048, 1.005], [-0.031, 1.005], [-0.031, 0.996], [-0.040, 0.987],\n",
+    "    [-0.045, 0.980], [-0.052, 0.975], [-0.040, 0.973], [-0.026, 0.968],\n",
+    "    [-0.020, 0.954], [-0.006, 0.947], [ 0.003, 0.935], [ 0.006, 0.926],\n",
+    "    [ 0.005, 0.921], [ 0.022, 0.923], [ 0.033, 0.912], [ 0.029, 0.905],\n",
+    "    [ 0.017, 0.900], [ 0.012, 0.895], [ 0.027, 0.893], [ 0.019, 0.886],\n",
+    "    [ 0.001, 0.883], [-0.012, 0.884], [-0.029, 0.883], [-0.038, 0.879],\n",
+    "    [-0.057, 0.881], [-0.062, 0.876], [-0.078, 0.876], [-0.087, 0.872],\n",
+    "    [-0.030, 0.907], [-0.007, 0.905], [-0.057, 0.916], [-0.025, 0.933],\n",
+    "    [-0.077, 0.990], [-0.059, 0.993]])\n",
+    "# Make lats + lons\n",
+    "x = xy[:, 0]*180/3.14159\n",
+    "y = xy[:, 1]*180/3.14159\n",
+    "\n",
+    "# A selected triangulation of the points.\n",
+    "triangles = np.asarray([\n",
+    "    [67, 66,  1], [65,  2, 66], [ 1, 66,  2], [64,  2, 65], [63,  3, 64],\n",
+    "    [60, 59, 57], [ 2, 64,  3], [ 3, 63,  4], [ 0, 67,  1], [62,  4, 63],\n",
+    "    [57, 59, 56], [59, 58, 56], [61, 60, 69], [57, 69, 60], [ 4, 62, 68],\n",
+    "    [ 6,  5,  9], [61, 68, 62], [69, 68, 61], [ 9,  5, 70], [ 6,  8,  7],\n",
+    "    [ 4, 70,  5], [ 8,  6,  9], [56, 69, 57], [69, 56, 52], [70, 10,  9],\n",
+    "    [54, 53, 55], [56, 55, 53], [68, 70,  4], [52, 56, 53], [11, 10, 12],\n",
+    "    [69, 71, 68], [68, 13, 70], [10, 70, 13], [51, 50, 52], [13, 68, 71],\n",
+    "    [52, 71, 69], [12, 10, 13], [71, 52, 50], [71, 14, 13], [50, 49, 71],\n",
+    "    [49, 48, 71], [14, 16, 15], [14, 71, 48], [17, 19, 18], [17, 20, 19],\n",
+    "    [48, 16, 14], [48, 47, 16], [47, 46, 16], [16, 46, 45], [23, 22, 24],\n",
+    "    [21, 24, 22], [17, 16, 45], [20, 17, 45], [21, 25, 24], [27, 26, 28],\n",
+    "    [20, 72, 21], [25, 21, 72], [45, 72, 20], [25, 28, 26], [44, 73, 45],\n",
+    "    [72, 45, 73], [28, 25, 29], [29, 25, 31], [43, 73, 44], [73, 43, 40],\n",
+    "    [72, 73, 39], [72, 31, 25], [42, 40, 43], [31, 30, 29], [39, 73, 40],\n",
+    "    [42, 41, 40], [72, 33, 31], [32, 31, 33], [39, 38, 72], [33, 72, 38],\n",
+    "    [33, 38, 34], [37, 35, 38], [34, 38, 35], [35, 37, 36]])\n",
+    "\n",
+    "trimesh = gv.TriMesh((triangles, (x, y)), crs=ccrs.PlateCarree())"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gf.coastline.opts(line_color='red', scale='50m', width=600, height=500) * trimesh.opts(padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 74 - 0
datashader-work/geoviews-examples/gallery/bokeh/vectorfield_example.ipynb

@@ -0,0 +1,74 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "from cartopy.examples import arrows\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "xs, ys, U, V, crs = arrows.sample_data()\n",
+    "mag = np.sqrt(U**2 + V**2)\n",
+    "angle = (np.pi/2.) - np.arctan2(U/mag, V/mag)\n",
+    "tiles = gv.tile_sources.Wikipedia\n",
+    "vectorfield = gv.VectorField((xs, ys, angle, mag), crs=crs)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles * vectorfield.opts(magnitude='Magnitude', width=600, height=500, padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 79 - 0
datashader-work/geoviews-examples/gallery/bokeh/world_population.ipynb

@@ -0,0 +1,79 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geoviews as gv\n",
+    "\n",
+    "from geoviews import dim\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "cities = pd.read_csv('../../assets/cities.csv', encoding=\"ISO-8859-1\")\n",
+    "population = gv.Dataset(cities, kdims=['City', 'Country', 'Year'])\n",
+    "points = population.to(gv.Points, ['Longitude', 'Latitude'], ['Population', 'City', 'Country'])\n",
+    "\n",
+    "tiles = gv.tile_sources.Wikipedia"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles * points.opts(\n",
+    "    color='Population', cmap='viridis', size=dim('Population')*0.000001,\n",
+    "    tools=['hover'], global_extent=True, width=600, height=600)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 75 - 0
datashader-work/geoviews-examples/gallery/bokeh/xarray_image.ipynb

@@ -0,0 +1,75 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "import xarray as xr\n",
+    "from cartopy import crs\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "ensemble = xr.open_dataset('../../data/ensemble.nc')\n",
+    "dataset = gv.Dataset(ensemble, ['longitude', 'latitude', 'time'], 'surface_temperature', crs=crs.PlateCarree())\n",
+    "images = dataset.to(gv.Image)\n",
+    "# Equivalent full definition:\n",
+    "# images = dataset.to(gv.Image, ['longitude', 'latitude'], 'surface_temperature', 'time')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "images.opts(cmap='viridis', colorbar=True, width=600, height=500) * gf.coastline"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 71 - 0
datashader-work/geoviews-examples/gallery/bokeh/xarray_quadmesh.ipynb

@@ -0,0 +1,71 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import xarray as xr\n",
+    "import geoviews as gv\n",
+    "\n",
+    "gv.extension('bokeh')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles = gv.tile_sources.EsriImagery\n",
+    "rasm = xr.tutorial.open_dataset('rasm').load()\n",
+    "qmeshes = gv.Dataset(rasm.Tair[::4, ::3, ::3]).to(gv.QuadMesh, groupby='time')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles * qmeshes.opts(width=700, height=350)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 89 - 0
datashader-work/geoviews-examples/gallery/matplotlib/airport_graph.ipynb

@@ -0,0 +1,89 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "from bokeh.sampledata.airport_routes import airports, routes\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(fig='svg')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# Count the number of connections from each airport\n",
+    "counts = routes.groupby('SourceID')[['Stops']].count().reset_index().rename(columns={'Stops': 'Connections'})\n",
+    "airports_df = pd.merge(airports, counts, left_on='AirportID', right_on='SourceID', how='left')\n",
+    "\n",
+    "# Select only US mainland airports & convert from Mercator to Latitudes/Longitudes\n",
+    "airport_points = gv.Points(airports_df, ['Longitude', 'Latitude'])[-170:-50, 0: 50]\n",
+    "\n",
+    "# Declare nodes, graph and tiles\n",
+    "nodes = gv.Nodes(airport_points, ['Longitude', 'Latitude', 'AirportID'],\n",
+    "                 ['Name', 'City', 'Connections'])\n",
+    "graph = gv.Graph((routes, nodes), ['SourceID', 'DestinationID'], ['Source', 'Destination'])\n",
+    "tiles = gv.tile_sources.Wikipedia\n",
+    "\n",
+    "# Select 50 busiest airports\n",
+    "busiest = list(routes.groupby('SourceID').count().sort_values('Stops').iloc[-50:].index.values)\n",
+    "busiest_airports = graph.select(AirportID=busiest, selection_mode='nodes')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gf.ocean * gf.land * gf.coastline * gf.borders * busiest_airports.opts(\n",
+    "    node_size=8, edge_linewidth=1, edge_alpha=0.05, fig_size=300, padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 74 - 0
datashader-work/geoviews-examples/gallery/matplotlib/brexit_choropleth.ipynb

@@ -0,0 +1,74 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geopandas as gpd\n",
+    "import geoviews as gv\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "gv.output(fig='svg', size=200)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Declaring data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "geometries = gpd.read_file('../../assets/boundaries/boundaries.shp')\n",
+    "referendum = pd.read_csv('../../assets/referendum.csv')\n",
+    "gdf = gpd.GeoDataFrame(pd.merge(geometries, referendum))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gv.Polygons(gdf, vdims=['name', 'leaveVoteshare'], label='Brexit Referendum Vote').opts(\n",
+    "    color='leaveVoteshare', colorbar=True, padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 80 - 0
datashader-work/geoviews-examples/gallery/matplotlib/city_population.ipynb

@@ -0,0 +1,80 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geoviews as gv\n",
+    "\n",
+    "from geoviews import dim, tile_sources as gvts\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(dpi=120)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Declare data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "cities = pd.read_csv('../../assets/cities.csv', encoding=\"ISO-8859-1\")\n",
+    "\n",
+    "points = gv.Points(cities, ['Longitude', 'Latitude'], ['City', 'Population', 'Country', 'Year'],\n",
+    "                   group='Top 20 Cities by population in 2050').select(Year=2050).sort('Population').iloc[-20:]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "(gvts.CartoMidnight().opts(zoom=1) *\n",
+    " points.opts(\n",
+    "    s=dim('Population')*0.00002, color='Population', cmap='viridis',\n",
+    "    fig_size=300, global_extent=True) *\n",
+    " gv.Labels(points).opts(color='white'))"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 91 - 0
datashader-work/geoviews-examples/gallery/matplotlib/filled_contours.ipynb

@@ -0,0 +1,91 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "import cartopy.crs as ccrs\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(fig='svg', size=200)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def sample_data(shape=(73, 145)):\n",
+    "    \"\"\"Returns ``lons``, ``lats`` and ``data`` of some fake data.\"\"\"\n",
+    "    nlats, nlons = shape\n",
+    "    ys = np.linspace(-np.pi / 2, np.pi / 2, nlats)\n",
+    "    xs = np.linspace(0, 2 * np.pi, nlons)\n",
+    "    lons, lats = np.meshgrid(xs, ys)\n",
+    "    wave = 0.75 * (np.sin(2 * lats) ** 8) * np.cos(4 * lons)\n",
+    "    mean = 0.5 * np.cos(2 * lats) * ((np.sin(2 * lats)) ** 2 + 2)\n",
+    "\n",
+    "    lats = np.rad2deg(ys)\n",
+    "    lons = np.rad2deg(xs)\n",
+    "    data = wave + mean\n",
+    "\n",
+    "    return lons, lats, data\n",
+    "\n",
+    "lons, lats, data = sample_data()\n",
+    "\n",
+    "# Make sure we declare the central longitude\n",
+    "contours = gv.FilledContours((lons, lats, data), crs=ccrs.PlateCarree(central_longitude=180))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "contours.opts(colorbar=True, levels=8, color_levels=10, cmap='nipy_spectral', projection=ccrs.Mollweide()) * gf.coastline"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 95 - 0
datashader-work/geoviews-examples/gallery/matplotlib/great_circle.ipynb

@@ -0,0 +1,95 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pyproj\n",
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "from bokeh.sampledata.airport_routes import airports, routes\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(fig='svg', size=250)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def get_circle_path(start, end, samples=200):\n",
+    "    sx, sy = start\n",
+    "    ex, ey = end\n",
+    "    g = pyproj.Geod(ellps='WGS84')\n",
+    "    (az12, az21, dist) = g.inv(sx, sy, ex, ey)\n",
+    "    lonlats = g.npts(sx, sy, ex, ey, samples)\n",
+    "    return np.array([(sx, sy)]+lonlats+[(ex, ey)])\n",
+    "\n",
+    "# Compute great-circle paths for all US flight routes from Honolulu\n",
+    "paths = []\n",
+    "honolulu = (-157.9219970703125, 21.318700790405273)\n",
+    "routes = routes[routes.SourceID==3728]\n",
+    "airports = airports[airports.AirportID.isin(list(routes.DestinationID)+[3728])]\n",
+    "for i, route in routes.iterrows():\n",
+    "    airport = airports[airports.AirportID==route.DestinationID].iloc[0]\n",
+    "    paths.append(get_circle_path(honolulu, (airport.Longitude, airport.Latitude)))\n",
+    "\n",
+    "# Define Graph from Nodes and EdgePaths\n",
+    "path = gv.EdgePaths(paths)\n",
+    "points = gv.Nodes(airports, ['Longitude', 'Latitude', 'AirportID'], ['Name', 'City'])\n",
+    "graph = gv.Graph((routes, points, path), ['SourceID', 'DestinationID'])"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gf.ocean * gf.land * gf.lakes * gf.coastline * graph.opts(\n",
+    "    node_color='black', node_size=8)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 116 - 0
datashader-work/geoviews-examples/gallery/matplotlib/katrina_track.ipynb

@@ -0,0 +1,116 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geoviews as gv\n",
+    "import cartopy.io.shapereader as shpreader\n",
+    "import shapely.geometry as sgeom\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(fig='svg', size=250)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def sample_data():\n",
+    "    \"\"\"\n",
+    "    Returns a list of latitudes and a list of longitudes (lons, lats)\n",
+    "    for Hurricane Katrina (2005).\n",
+    "\n",
+    "    The data was originally sourced from the HURDAT2 dataset from AOML/NOAA:\n",
+    "    http://www.aoml.noaa.gov/hrd/hurdat/newhurdat-all.html on 14th Dec 2012.\n",
+    "\n",
+    "    \"\"\"\n",
+    "    lons = [-75.1, -75.7, -76.2, -76.5, -76.9, -77.7, -78.4, -79.0,\n",
+    "            -79.6, -80.1, -80.3, -81.3, -82.0, -82.6, -83.3, -84.0,\n",
+    "            -84.7, -85.3, -85.9, -86.7, -87.7, -88.6, -89.2, -89.6,\n",
+    "            -89.6, -89.6, -89.6, -89.6, -89.1, -88.6, -88.0, -87.0,\n",
+    "            -85.3, -82.9]\n",
+    "\n",
+    "    lats = [23.1, 23.4, 23.8, 24.5, 25.4, 26.0, 26.1, 26.2, 26.2, 26.0,\n",
+    "            25.9, 25.4, 25.1, 24.9, 24.6, 24.4, 24.4, 24.5, 24.8, 25.2,\n",
+    "            25.7, 26.3, 27.2, 28.2, 29.3, 29.5, 30.2, 31.1, 32.6, 34.1,\n",
+    "            35.6, 37.0, 38.6, 40.1]\n",
+    "\n",
+    "    return lons, lats\n",
+    "\n",
+    "shapename = 'admin_1_states_provinces_lakes_shp'\n",
+    "states_shp = shpreader.natural_earth(resolution='110m',\n",
+    "                                     category='cultural', name=shapename)\n",
+    "\n",
+    "lons, lats = sample_data()\n",
+    "track = sgeom.LineString(zip(lons, lats))\n",
+    "\n",
+    "title = 'US States which intersect the track of Hurricane Katrina (2005)'\n",
+    "\n",
+    "track_buffer = track.buffer(2)\n",
+    "shapes = []\n",
+    "for state in shpreader.Reader(states_shp).geometries():\n",
+    "    # pick a default color for the land with a black outline,\n",
+    "    # this will change if the storm intersects with our track\n",
+    "    facecolor = [0.9375, 0.9375, 0.859375]\n",
+    "\n",
+    "    if state.intersects(track):\n",
+    "        facecolor = 'red'\n",
+    "    elif state.intersects(track_buffer):\n",
+    "        facecolor = '#FF7E00'\n",
+    "    shapes.append(gv.Shape(state).opts(facecolor=facecolor))\n",
+    "shapes.append(gv.Shape(track_buffer).opts(alpha=0.5))\n",
+    "shapes.append(gv.Shape(track).opts(facecolor='none'))"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gv.Overlay(shapes).relabel(title)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 78 - 0
datashader-work/geoviews-examples/gallery/matplotlib/new_york_boroughs.ipynb

@@ -0,0 +1,78 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geopandas as gpd\n",
+    "import geoviews as gv\n",
+    "import cartopy.crs as ccrs\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "gv.output(dpi=120, fig='svg')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles = gv.tile_sources.Wikipedia \n",
+    "\n",
+    "# Project data to Web Mercator\n",
+    "nybb = gpd.read_file(gpd.datasets.get_path('nybb'))\n",
+    "poly_data = nybb.to_crs(ccrs.GOOGLE_MERCATOR.proj4_init)\n",
+    "polys = gv.Polygons(poly_data, vdims='BoroName', crs=ccrs.GOOGLE_MERCATOR)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "scrolled": false
+   },
+   "outputs": [],
+   "source": [
+    "tiles.opts(zoom=10) * polys.opts(color='BoroName', cmap='tab20', fig_size=200, padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 96 - 0
datashader-work/geoviews-examples/gallery/matplotlib/orthographic_vectorfield.ipynb

@@ -0,0 +1,96 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "import cartopy.crs as ccrs\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(fig='svg', size=200)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def sample_data(shape=(20, 30)):\n",
+    "    \"\"\"\n",
+    "    Returns ``(x, y, u, v, crs)`` of some vector data\n",
+    "    computed mathematically. The returned crs will be a rotated\n",
+    "    pole CRS, meaning that the vectors will be unevenly spaced in\n",
+    "    regular PlateCarree space.\n",
+    "\n",
+    "    \"\"\"\n",
+    "    crs = ccrs.RotatedPole(pole_longitude=177.5, pole_latitude=37.5)\n",
+    "\n",
+    "    x = np.linspace(311.9, 391.1, shape[1])\n",
+    "    y = np.linspace(-23.6, 24.8, shape[0])\n",
+    "\n",
+    "    x2d, y2d = np.meshgrid(x, y)\n",
+    "    u = 10 * (2 * np.cos(2 * np.deg2rad(x2d) + 3 * np.deg2rad(y2d + 30)) ** 2)\n",
+    "    v = 20 * np.cos(6 * np.deg2rad(x2d))\n",
+    "\n",
+    "    return x, y, u, v, crs\n",
+    "\n",
+    "xs, ys, U, V, crs = sample_data()\n",
+    "mag = np.sqrt(U**2 + V**2)\n",
+    "angle = (np.pi/2.) - np.arctan2(U/mag, V/mag)\n",
+    "vectorfield = gv.VectorField((xs, ys, angle, mag), crs=crs)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gf.ocean * gf.coastline * gf.land * vectorfield.opts(\n",
+    "    magnitude='Magnitude', show_grid=True, projection=ccrs.Orthographic(-10, 45), global_extent=True)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 59 - 0
datashader-work/geoviews-examples/gallery/matplotlib/tile_sources.ipynb

@@ -0,0 +1,59 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geoviews as gv\n",
+    "\n",
+    "from geoviews import opts, tile_sources as gvts\n",
+    "\n",
+    "gv.extension('matplotlib')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "opts.defaults(\n",
+    "    opts.Layout(sublabel_format='', vspace=0.1, hspace=0.1, fig_size=200),\n",
+    "    opts.WMTS(zoom=0))\n",
+    "\n",
+    "(gvts.OSM + gvts.Wikipedia + gvts.StamenToner + gvts.EsriNatGeo +\n",
+    " gvts.EsriImagery + gvts.EsriUSATopo + gvts.EsriTerrain + gvts.EsriReference).cols(4)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 117 - 0
datashader-work/geoviews-examples/gallery/matplotlib/trimesh_uk.ipynb

@@ -0,0 +1,117 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "import cartopy.crs as ccrs\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(fig='svg', size=200)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# Some points defining a triangulation over (roughly) Britain.\n",
+    "xy = np.asarray([\n",
+    "    [-0.101, 0.872], [-0.080, 0.883], [-0.069, 0.888], [-0.054, 0.890],\n",
+    "    [-0.045, 0.897], [-0.057, 0.895], [-0.073, 0.900], [-0.087, 0.898],\n",
+    "    [-0.090, 0.904], [-0.069, 0.907], [-0.069, 0.921], [-0.080, 0.919],\n",
+    "    [-0.073, 0.928], [-0.052, 0.930], [-0.048, 0.942], [-0.062, 0.949],\n",
+    "    [-0.054, 0.958], [-0.069, 0.954], [-0.087, 0.952], [-0.087, 0.959],\n",
+    "    [-0.080, 0.966], [-0.085, 0.973], [-0.087, 0.965], [-0.097, 0.965],\n",
+    "    [-0.097, 0.975], [-0.092, 0.984], [-0.101, 0.980], [-0.108, 0.980],\n",
+    "    [-0.104, 0.987], [-0.102, 0.993], [-0.115, 1.001], [-0.099, 0.996],\n",
+    "    [-0.101, 1.007], [-0.090, 1.010], [-0.087, 1.021], [-0.069, 1.021],\n",
+    "    [-0.052, 1.022], [-0.052, 1.017], [-0.069, 1.010], [-0.064, 1.005],\n",
+    "    [-0.048, 1.005], [-0.031, 1.005], [-0.031, 0.996], [-0.040, 0.987],\n",
+    "    [-0.045, 0.980], [-0.052, 0.975], [-0.040, 0.973], [-0.026, 0.968],\n",
+    "    [-0.020, 0.954], [-0.006, 0.947], [ 0.003, 0.935], [ 0.006, 0.926],\n",
+    "    [ 0.005, 0.921], [ 0.022, 0.923], [ 0.033, 0.912], [ 0.029, 0.905],\n",
+    "    [ 0.017, 0.900], [ 0.012, 0.895], [ 0.027, 0.893], [ 0.019, 0.886],\n",
+    "    [ 0.001, 0.883], [-0.012, 0.884], [-0.029, 0.883], [-0.038, 0.879],\n",
+    "    [-0.057, 0.881], [-0.062, 0.876], [-0.078, 0.876], [-0.087, 0.872],\n",
+    "    [-0.030, 0.907], [-0.007, 0.905], [-0.057, 0.916], [-0.025, 0.933],\n",
+    "    [-0.077, 0.990], [-0.059, 0.993]])\n",
+    "# Make lats + lons\n",
+    "x = xy[:, 0]*180/3.14159\n",
+    "y = xy[:, 1]*180/3.14159\n",
+    "\n",
+    "# A selected triangulation of the points.\n",
+    "triangles = np.asarray([\n",
+    "    [67, 66,  1], [65,  2, 66], [ 1, 66,  2], [64,  2, 65], [63,  3, 64],\n",
+    "    [60, 59, 57], [ 2, 64,  3], [ 3, 63,  4], [ 0, 67,  1], [62,  4, 63],\n",
+    "    [57, 59, 56], [59, 58, 56], [61, 60, 69], [57, 69, 60], [ 4, 62, 68],\n",
+    "    [ 6,  5,  9], [61, 68, 62], [69, 68, 61], [ 9,  5, 70], [ 6,  8,  7],\n",
+    "    [ 4, 70,  5], [ 8,  6,  9], [56, 69, 57], [69, 56, 52], [70, 10,  9],\n",
+    "    [54, 53, 55], [56, 55, 53], [68, 70,  4], [52, 56, 53], [11, 10, 12],\n",
+    "    [69, 71, 68], [68, 13, 70], [10, 70, 13], [51, 50, 52], [13, 68, 71],\n",
+    "    [52, 71, 69], [12, 10, 13], [71, 52, 50], [71, 14, 13], [50, 49, 71],\n",
+    "    [49, 48, 71], [14, 16, 15], [14, 71, 48], [17, 19, 18], [17, 20, 19],\n",
+    "    [48, 16, 14], [48, 47, 16], [47, 46, 16], [16, 46, 45], [23, 22, 24],\n",
+    "    [21, 24, 22], [17, 16, 45], [20, 17, 45], [21, 25, 24], [27, 26, 28],\n",
+    "    [20, 72, 21], [25, 21, 72], [45, 72, 20], [25, 28, 26], [44, 73, 45],\n",
+    "    [72, 45, 73], [28, 25, 29], [29, 25, 31], [43, 73, 44], [73, 43, 40],\n",
+    "    [72, 73, 39], [72, 31, 25], [42, 40, 43], [31, 30, 29], [39, 73, 40],\n",
+    "    [42, 41, 40], [72, 33, 31], [32, 31, 33], [39, 38, 72], [33, 72, 38],\n",
+    "    [33, 38, 34], [37, 35, 38], [34, 38, 35], [35, 37, 36]])\n",
+    "\n",
+    "trimesh = gv.TriMesh((triangles, (x, y)), crs=ccrs.PlateCarree())"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "gf.coastline().opts(edgecolor='red', scale='50m') * trimesh.opts(padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 76 - 0
datashader-work/geoviews-examples/gallery/matplotlib/vectorfield_example.ipynb

@@ -0,0 +1,76 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np\n",
+    "import geoviews as gv\n",
+    "from cartopy.examples import arrows\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "\n",
+    "gv.output(fig='svg', size=200)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "xs, ys, U, V, crs = arrows.sample_data()\n",
+    "mag = np.sqrt(U**2 + V**2)\n",
+    "angle = (np.pi/2.) - np.arctan2(U/mag, V/mag)\n",
+    "tiles = gv.tile_sources.Wikipedia\n",
+    "vectorfield = gv.VectorField((xs, ys, angle, mag), crs=crs)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles.opts(zoom=4) * vectorfield.opts(magnitude='Magnitude', padding=0.1)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 77 - 0
datashader-work/geoviews-examples/gallery/matplotlib/world_population.ipynb

@@ -0,0 +1,77 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import pandas as pd\n",
+    "import geoviews as gv\n",
+    "\n",
+    "from geoviews import dim\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "gv.output(fig='svg', size=200)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "cities = pd.read_csv('../../assets/cities.csv', encoding=\"ISO-8859-1\")\n",
+    "population = gv.Dataset(cities, kdims=['City', 'Country', 'Year'])\n",
+    "points = population.to(gv.Points, ['Longitude', 'Latitude'], ['Population', 'City', 'Country'])\n",
+    "\n",
+    "tiles = gv.tile_sources.Wikipedia"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles.opts(zoom=0) * points.opts(\n",
+    "    s=dim('Population')*0.00001, color='Population', cmap='viridis', global_extent=True)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 75 - 0
datashader-work/geoviews-examples/gallery/matplotlib/xarray_image.ipynb

@@ -0,0 +1,75 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import geoviews as gv\n",
+    "import geoviews.feature as gf\n",
+    "import xarray as xr\n",
+    "from cartopy import crs\n",
+    "\n",
+    "gv.extension('matplotlib')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "ensemble = xr.open_dataset('../../data/ensemble.nc')\n",
+    "dataset = gv.Dataset(ensemble, ['longitude', 'latitude', 'time'], 'surface_temperature', crs=crs.PlateCarree())\n",
+    "images = dataset.to(gv.Image)\n",
+    "# Equivalent full definition:\n",
+    "# images = dataset.to(gv.Image, ['longitude', 'latitude'], 'surface_temperature', 'time')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "images.opts(cmap='viridis', colorbar=True, fig_size=250) * gf.coastline"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 73 - 0
datashader-work/geoviews-examples/gallery/matplotlib/xarray_quadmesh.ipynb

@@ -0,0 +1,73 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import xarray as xr\n",
+    "import cartopy.crs as ccrs\n",
+    "import geoviews as gv\n",
+    "\n",
+    "gv.extension('matplotlib')\n",
+    "gv.output(fig='svg', size=300)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Define data"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles = gv.tile_sources.EsriImagery\n",
+    "rasm = xr.tutorial.open_dataset('rasm').load()\n",
+    "qmeshes = gv.Dataset(rasm.Tair[::4, ::3, ::3]).to(gv.QuadMesh, groupby='time')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Plot"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tiles.opts(zoom=1) * qmeshes.opts(projection=ccrs.GOOGLE_MERCATOR)"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.6.6"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

File diff suppressed because it is too large
+ 349 - 0
datashader-work/geoviews-examples/user_guide/Geometries.ipynb


File diff suppressed because it is too large
+ 341 - 0
datashader-work/geoviews-examples/user_guide/Gridded_Datasets_I.ipynb


File diff suppressed because it is too large
+ 322 - 0
datashader-work/geoviews-examples/user_guide/Gridded_Datasets_II.ipynb


File diff suppressed because it is too large
+ 2078 - 0
datashader-work/geoviews-examples/user_guide/Projections.ipynb


File diff suppressed because it is too large
+ 406 - 0
datashader-work/geoviews-examples/user_guide/Resampling_Grids.ipynb


File diff suppressed because it is too large
+ 220 - 0
datashader-work/geoviews-examples/user_guide/Working_with_Bokeh.ipynb