<jupyter_start><jupyter_text>Welcome to the Google Earth Engine (GEE) Python API! These notebooks will provide an overview of how to use the GEE python API and access all it has to offer.  Notebook 3: Visualizing Data using geemap This notebook covers a quick look into the _geemap_ package, which provides simple python tools for plotting earth engine datasets.Feel free to check out [geemap.org](http://geemap.org) for more information.  1. Creating a map Creating a map using geemap is simple: Just call _geemap.Map()_<jupyter_code>import ee
ee.Initialize()
import geemap
Map = geemap.Map()
Map<jupyter_output><empty_output><jupyter_text>This creates an interactive plot with __tons__ of features. Feel free to click around on the above map and explore some of the built-in tools. You can pass different arguments, including a (lat,lon) point to center the map and a zoom level. Also, the basemap can be changed to any object in the _geemap.basemaps_ dictionary (such as 'HYBRID', 'SATELLITE', or 'NLCD 2019 CONUS Land Cover'):<jupyter_code>Map = geemap.Map(center = (40.015,-105),zoom=4,basemap='HYBRID')
Map<jupyter_output><empty_output><jupyter_text>2. Adding GEE features As in the last notebook, you can add features from GEE to these maps using _Map.addLayer()_. Let's use the TIGER county database as an example:<jupyter_code>county_name = 'Boulder'
counties = ee.FeatureCollection('TIGER/2018/Counties')
boulderCo = ee.Feature(counties.filter(ee.Filter.eq("NAME", county_name)).first())
Map = geemap.Map(center = (40.015,-105),zoom=6,basemap='HYBRID')
Map.addLayer(boulderCo,{'opacity':.5,'color':'red'},'County Boundary')
Map<jupyter_output><empty_output><jupyter_text>The map above can also be set to a center on a given feature:<jupyter_code>Map.centerObject(boulderCo, 10)<jupyter_output><empty_output><jupyter_text>ee.Feature is called above to get the single feature from the feature collection. However, an entire feature collection can be plotted in the same way. Let's look at all counties in the US named "Jefferson":<jupyter_code>county_name = 'Jefferson'
jeffersonCounties = counties.filter(ee.Filter.eq("NAME", county_name))
Map = geemap.Map(center = (40.015,-97.5),zoom=4,basemap='HYBRID')
Map.addLayer(jeffersonCounties,{'opacity':.5,'color':'yellow'},'Jefferson Counties')
Map<jupyter_output><empty_output><jupyter_text>Quite a few!   3. Adding GEE images An image can be added in the exact same way. Let's use the landsat images we used in the last notebook. To refresh, these file IDs were:- LC08_L2SP_033032_20210511_20210524_02_T2- LC08_L2SP_033033_20210511_20210524_02_T2Let's use just the first one for now:<jupyter_code>landsat_img  = ee.ImageCollection('LANDSAT/LC08/C02/T2_L2')\
                                .filter(ee.Filter.eq('LANDSAT_PRODUCT_ID', 'LC08_L2SP_033032_20210511_20210524_02_T2')).first()
##to refresh, the properties within the image collection on which to filter can be listed with:
col= ee.ImageCollection('LANDSAT/LC08/C02/T2_L2')
col.first().propertyNames().getInfo()
col.first().getInfo()['bands']
Map = geemap.Map(basemap='HYBRID')
Map.addLayer(landsat_img.select('SR_B7'), {'min': 20000, 'max': 25000}, 'Landsat Band 7')
Map.centerObject(landsat_img.select('SR_B7'), 8)
Map<jupyter_output><empty_output><jupyter_text>Additionally, images can be clipped to the bounds of a feature:<jupyter_code>landsat_img_clipped = landsat_img.clip(boulderCo)
Map = geemap.Map(basemap='HYBRID')
Map.centerObject(boulderCo, 10)
vis_params = {
    'color': 'red', 
    'lineType': 'solid',
    'strokeWidth':20,
    'fillColor': None}
Map.addLayer(boulderCo,vis_params,'County Boundary')
Map.addLayer(landsat_img_clipped.select('SR_B1'), {'min': 20000, 'max': 50000}, 'Landsat Band 1')
Map<jupyter_output><empty_output><jupyter_text>4. Adding image collections Instead of adding one image at a time, entire collections can be plotted. For example, let's plot all the landsat images from a given day<jupyter_code>ls_collection  = ee.ImageCollection('LANDSAT/LC08/C02/T2_L2').filterDate('2021-07-04', '2021-07-05')
print(str(ls_collection.size().getInfo())+' images in filtered collection')
Map = geemap.Map(center = (40.015,-105),zoom=2,basemap='HYBRID')
Map.addLayer(ls_collection, {'bands':['SR_B1'],'min':20000,'max':50000}, "Landsat images")
Map<jupyter_output><empty_output><jupyter_text>This is one way to visualize the imagery coverage from a given sensor and time range. Additionally, images from other sensors can be added to the same map:<jupyter_code>s2_collection  = ee.ImageCollection("COPERNICUS/S2_SR").filterDate('2021-07-04T00:00', '2021-07-04T02:00')
print(str(s2_collection.size().getInfo())+' images in filtered collection')
Map.addLayer(s2_collection, {'bands':['B1'],'min':0,'max':2000}, "Sentinel-2 images")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12221528211534458, 'fraction_numerical': 0.05142619196335624, 'mean_word_length': 6.60126582278481, 'pattern_counts': {'":': 1, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '236558', 'license': 'MIT', 'n_tokens_mistral': 1819, 'n_tokens_neox': 1642, 'n_words': 443, 'path': '03_plotting.ipynb', 'repo_name': 'sfons/EarthEngine_pythonAPI_tutorial', 'size': '4803'}