Create a map and a label:
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:60% !important; }</style>"))
from ipywidgets import widgets, Layout
map = Map(layout=Layout(height='800px'))
label = widgets.Label(layout=widgets.Layout(width='100%', max_width='1000px'))
widgets.VBox([map, label])
Load ships data and display as points with a compositing operation to sum them:
v = inter.VectorLayer("ships").opacity(255)
v.remove('default','all')
selection = "all"
v.set('default',selection,'point', 'comp-op', 'plus')
v.set('default',selection,'point', 'fill', '#020100')
v.set('default',selection,'point', 'width', '6')
v.set('default',selection,'point', 'height', '6')
v.set('default',selection,'point', 'allow-overlap', 'true')
v.set('default',selection,'point', 'stroke-width', '0')
v.set('default',selection,'point', 'placement', 'point')
v.set('default',selection,'point', 'marker-type', 'ellipse')
map.clear()
map.addLayer(v.toLayer())
mark = inter.identify(map,v,label)
Create a map:
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:60% !important; }</style>"))
from ipywidgets import widgets, Layout
map = Map(center=[39, 12],zoom=6,layout=Layout(height='600px'))
map
Load ships data and display in heatmap mode selecting a color scheme:
v = inter.VectorLayer("ships").heatmap(2000.0,"inv_nimages",0,0.05).opacity(190)
v.colorScheme("RdYlGn_mixed_exp")
#v.colorScheme("RdYlBu_mixed_exp")
#v.colorScheme("YlOrBr_mixed_exp")
#v.colorScheme("YlOrRd_mixed_exp")
#v.colorScheme("Spectral_mixed_exp")
map.clear()
map.addLayer(v.toLayer())
Using countries VectorLayer to mask:
countries = inter.VectorLayer("countries")
countries.remove('default','all')
countries.set('poly','fill','#ff0000')
pc = countries.process()
v = inter.VectorLayer("ships").heatmap(30000.0,"inv_nimages",0,0.05).opacity(190).process().invmask(pc)
v.colorScheme("YlOrRd_mixed_exp")
map.clear()
map.addLayer(v.toLayer())