VectorLayer Natura2000 sample¶

Experiment with Natura2000 vector dataset (Habitats and Birds protected sites)

In [ ]:
map = Map()
map.zoomToExtent(inter.search("Toulouse"))
map

LegendNatura2000

Define a custom identify function to create links to official Natura2000 site

In [ ]:
from jeodpp.imap import Marker
from IPython.core.display import display, HTML
from IPython.display import clear_output

def identify(map, vector):
    vector.parameter("identify","all")
    
    def OnChangedLocation(event, location):
        vector.parameter("identifyfield","SITECODE")
        codes = vector.identifyPoint(location[1],location[0],4326,map.zoom)
        vector.parameter("identifyfield","SITENAME")
        names = vector.identifyPoint(location[1],location[0],4326,map.zoom)
        names = unicode(names, encoding="utf-8", errors="ignore")
        clear_output()
        codelist = codes.split('#')
        namelist = names.split('#')
        for i in range(len(codelist)):
            display(HTML("<a href='http://natura2000.eea.europa.eu/Natura2000/SDF.aspx?site="+
                         codelist[i]+"'target='_blank'>" + namelist[i] + "</a>"))

    mark = Marker(location=map.center,opacity=0.9)
    map += mark
    mark.on_move(OnChangedLocation)
    return mark

Display Natura2000 polygons and country borders on top of Core003 mosaic, then activate the identify

In [ ]:
p = inter.ImageCollection("C03").process().opacity(128)
v = inter.VectorLayer("natura2000").opacity(255)
c = inter.VectorLayer("countries").opacity(255)
map.clear()
map.addLayer(p.toLayer())
map.addLayer(v.toLayer())
map.addLayer(c.toLayer())
mark = identify(map,v)
In [ ]:
?inter.ImageCollection.filterOn
In [ ]: