Combining different source images in a MultiBand composition¶

It's possible to create a multi-band composition by putting togheter ImageProcess elements (even if originated from different ImageCollections)

In [ ]:
map = Map()
map

A simple multiband composition obtained by switching bands of Core003 ImageCollection (obtain a "false-color" visualization)

In [ ]:
p1 = inter.ImageCollection("C03").process().band("1")
p2 = inter.ImageCollection("C03").process().band("2")
p3 = inter.ImageCollection("C03").process().band("3")

bands = [p2, p1, p3]

p = inter.ImageProcess()
p = p.multi(bands).bands(1,2,3).opacity(255)

map.clear()
map.addLayer(p.toLayer())
In [ ]:
print p.numBands()

A more complex example with, masking, max processing step and custom colors

In [ ]:
map = Map()
map
In [ ]:
v = inter.VectorLayer("nuts1").opacity(128)
v.remove('default','all')
country = "[ICC] = 'IT'"
v.set('default',country,'poly','fill','#ff0000')
pItaly = v.process()

colors = ["Red", "Yellow", "Green"]

p1 = inter.ImageCollection("C03").process().band("1")
p2 = inter.ImageCollection("C03").process().band("2")
p3 = inter.ImageCollection("C03").process().band("3")

bands = [p1, p2, p3]

p = inter.ImageProcess()
p = p.multi(bands).max().mask(pItaly).scale(50,150).colorCustom(colors)

map.clear()
map.addLayer(p.toLayer())
In [ ]:
print p.numBands()

Multi-band segmentation

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

Segmentation on Core003 single band:

In [ ]:
p = inter.ImageCollection("C03").process().band("1").labelcc(64,128).modulo(256)
p.colorScheme("random")

map.clear()
map.addLayer(p.toLayer())

Segmentation on two Sentinel2 bands:

In [ ]:
coll = inter.ImageCollection("S2")
coll = coll.filterOnGeoName("Toulouse")
coll = coll.filterOnDate(2017,7,1, 2017,12,31)
coll = coll.filterOn("cloudcover", "<=", 0)
coll = coll.filterOn("jrc_filepath", "<>", "")
coll.limit(100)
coll.sort("cloudcover",True)

b4 = coll.process().band("B04")
b3 = coll.process().band("B03")

bands = [b4, b3]

p = inter.ImageProcess()
p = p.multi(bands).labelcc(256,1024).modulo(256)
p.colorScheme("random")

map.clear()
map.addLayer(p.toLayer())
In [ ]: