import ee from ee_plugin import Map # Set a custom basemap style and default to the satellite map type. styles = { 'Soft Blue': [{ 'featureType': 'all', 'stylers': [{ 'saturation': -80 }] }, { 'featureType': 'road.arterial', 'elementType': 'geometry', 'stylers': [{ 'hue': '#00ffee' }, { 'saturation': 50 }] }, { 'featureType': 'poi.business', 'elementType': 'labels', 'stylers': [{ 'visibility': 'off' }] }] } Map.setOptions('satellite', styles)
import ee from ee_plugin import Map # Load a Landsat 8 image. image = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140318') # Create NDVI and NDWI spectral indices. ndvi = image.normalizedDifference(['B5', 'B4']) ndwi = image.normalizedDifference(['B3', 'B5']) # Create a binary layer using logical operations. bare = ndvi.lt(0.2).And(ndwi.lt(0)) # Mask and display the binary layer. Map.setCenter(-122.3578, 37.7726, 12) Map.setOptions('satellite') Map.addLayer(bare.updateMask(bare), {}, 'bare')