VectorLayer MGRS sample¶

Experiment with MGRS vector dataset (Military Grid Reference System, the grid used by ESA for the Sentinel products tiles)

In [ ]:
map = Map()
map

Default display of the MGSR VectorLayer

In [ ]:
v = inter.VectorLayer("mgrs")
#v.printXML()
map.clear()
tlayer = map.addLayer(v.toLayer())

Change text and symbol properties

In [ ]:
v = inter.VectorLayer("mgrs").opacity(255)
v.set('default',"all",'line','stroke-width','1')
#v.remove('default','all')
#v.remove('labels','all')
v.set('labels','all','text','size','14')
v.set('zones','all','text','size','10')
v.set('zones','all','text','fill','#660000')
map.clear()
tlayer = map.addLayer(v.toLayer())

Highlighting an UTM fuse

In [ ]:
v = inter.VectorLayer("mgrs").opacity(255)
fuse32 = "[Name].match('32[A-Z]*')"
v.set('default',fuse32,'poly','fill','#00ffff44')
map.clear()
tlayer = map.addLayer(v.toLayer())

Highlighting two UTM zones

In [ ]:
v = inter.VectorLayer("mgrs").opacity(255)
zone32T = "[Name].match('32T[A-Z]*')"
v.set('default',zone32T,'poly','fill','#ff000044')

zone33S = "[Name].match('33S[A-Z]*')"
v.set('default',zone33S,'poly','fill','#00ff0055')

#v.set('default',"[Name] = '33TUH'",'line','stroke','#000000')
#v.set('default',"[Name] = '33TUH'",'poly','fill','#00ff0044')

map.clear()
tlayer = map.addLayer(v.toLayer())

Highlighting a specific tile

In [ ]:
v = inter.VectorLayer("mgrs").opacity(255)
v.set("[Name] = '33TUH'",'line','stroke','#000000')
v.set("[Name] = '33TUH'",'poly','fill','#00ff0044')
map.clear()
tlayer = map.addLayer(v.toLayer())

Create another Map and a label to identify the vector layer

In [ ]:
from ipywidgets import widgets
map = Map()
label = widgets.Label(layout=widgets.Layout(width='100%', max_width='1000px'))
widgets.VBox([map, label])
In [ ]:
v = inter.VectorLayer("mgrs").opacity(255)
v.parameter("identify","all")
map.clear()
tlayer = map.addLayer(v.toLayer())
mark = inter.identify(map,v,label)

Search the vector layer with SQL syntax to filter feature and zoom on them

In [ ]:
res = v.search("Name = '33TUH'")
b = map.zoomToExtent(res)
In [ ]:
res = v.search("Name LIKE '12T%'")
b = map.zoomToExtent(res)

Display and identify S2orbits vector layer

In [ ]:
from ipywidgets import widgets
map = Map()
label = widgets.Label(layout=widgets.Layout(width='100%', max_width='1000px'))
widgets.VBox([map, label])
In [ ]:
v = inter.VectorLayer("S2orbits").opacity(255)
v.parameter("identify","all")
map.clear()
tlayer = map.addLayer(v.toLayer())
mark = inter.identify(map,v,label)
In [ ]: