<jupyter_start><jupyter_text>Exercise 1 - Load Image and Add a Layer https://developers.google.com/earth-engine/guides/image_visualizationcolab-python_2<jupyter_code>import ee
import folium
# Trigger the authentication flow.
ee.Authenticate()

# Initialize the library.
ee.Initialize()
# This is needed in python to add layers to Folium
def add_ee_layer(self, ee_image_object, vis_params, name):
    """Adds a method for displaying Earth Engine image tiles to folium map."""
    map_id_dict = ee.Image(ee_image_object).getMapId(vis_params)
    folium.raster_layers.TileLayer(
        tiles=map_id_dict['tile_fetcher'].url_format,
        attr='Map Data &copy; <a href="https://earthengine.google.com/">Google Earth Engine</a>',
        name=name,
        overlay=True,
        control=True
    ).add_to(self)


# Add EE drawing method to folium.
folium.Map.add_ee_layer = add_ee_layer<jupyter_output><empty_output><jupyter_text>In this example, band 'B5' is assigned to red, 'B4' is assigned to green, and 'B3' is assigned to blue.<jupyter_code># get a LANDSAT image
image = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140318');

#Define the visualization parameters.
vizParams = {
  'bands': ['B5', 'B4', 'B3'],
  'min': 0,
  'max': 0.5,
  'gamma': [0.3, 1.1, 1] #Change de values of pixel to get different spectrum
};
lat = 37.5010
lon = -122.1899
#Center the map and display the image.
myMap = folium.Map(location=[lat, lon], zoom_start=10)
myMap.add_ee_layer(image, vizParams, 'false color composite');
myMap<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12289780077619664, 'fraction_numerical': 0.03363518758085381, 'mean_word_length': 4.708487084870849, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '107622', 'license': 'MIT', 'n_tokens_mistral': 586, 'n_tokens_neox': 551, 'n_words': 143, 'path': '09-GoogleEarthEngine_master/01-Load Image and Add a Layer.ipynb', 'repo_name': 'Chilefase/MIT-1.001', 'size': '1546'}