<jupyter_start><jupyter_text>Tour the World with Landsat Imagery and Raster FunctionsThis notebook provides links to interesting locations using different band combinations of Landsat 8 imagery. A general description is provided for each location. The maps are live and you can navigate to any other location of the World and see the same bands.This notebook uses Landsat 8 imagery layer that is accessible from ArcGIS Online. The Landsat 8 imagery layer provides multiple scenes for every location and is updated with new scenes every day from USGS. The scenes can be used for both visualization and analysis. Typically, all locations are covered every 16 days.  Landsat imageryArcGIS Online provides multispectral landsat imagery layer, that we'll be using in this notebook. Let's connect to ArcGIS Online and query for the "Landsat Multispectral" imagery layer:<jupyter_code>from arcgis.gis import GIS
from arcgis.raster.functions import *
gis = GIS()
landsat_item = gis.content.search('"Landsat Multispectral"', 'Imagery Layer')[0]
landsat_item
landsat = landsat_item.layers[0]<jupyter_output><empty_output><jupyter_text>Raster processingThe examples below will be extracting a particular band combination from the landsat layer, and applying a 'Percent Clip' stretch to enhance the raster so it looks more vibrant. Here, we define a Python function that will first use the `extract_band` raster function to extract the specified band combination from the input raster, and then feed the output to the `stretch` raster function. This function will be used by each example below to display different points of interest around the world.<jupyter_code>def extract_stretch(bandids):
    return stretch(extract_band(landsat, bandids),
                   stretch_type='PercentClip',
                   min_percent=2, 
                   max_percent=2,
                   dra=True, 
                   gamma=[0.8,0.8,0.8])<jupyter_output><empty_output><jupyter_text>Cambridge Gulf, AustraliaCambridge Gulf is on an isolated stretch of the north coast of Western Australia. Mangroves thrive in this region that experiences wide tidal flows of 23-30 feet.Green vegetation appears green in this band combination. The blue band is set to the blue channel here, so the water appears blue. There is a lot of sediment in the water, which can be seen here.<jupyter_code>from arcgis.geocoding import geocode
area = geocode('Cambridge Gulf')[0]
m = gis.map(area, 10)
m<jupyter_output><empty_output><jupyter_text>![m](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_01.PNG)<jupyter_code>m.add_layer(extract_stretch([5, 4, 1]))<jupyter_output><empty_output><jupyter_text>Eye of the Sahara, MauritaniaThe Richat Structure of central Mauritania is also known as the Eye of the Sahara. It is a prominent geologic feature in the Sahara Desert, likely an eroded dome.Since this image is largely devoid of vegetation, bands are used to emphasize the geologic structure. These particular bands are not always used for geology, site specific minerals and characteristics may call for a different combination.<jupyter_code>m2 = gis.map("<NAME>", 11)
m2<jupyter_output><empty_output><jupyter_text>![m2](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_02.PNG)<jupyter_code>m2.add_layer(extract_stretch([6, 3, 1]))<jupyter_output><empty_output><jupyter_text>Gosses Bluff, AustraliaIn this map, the circular ring of hills is part of a unique and spectacular geological structure known as Gosses Bluff. Gosses Bluff was formed some 142 million years ago due to the impact of an asteroid or comet up to 1.2 miles (2 kilometers) in diameter. The central ring of hills is approximately 3 miles (5 kilometers) in diameter and rises 200 meters above the plain. It is surrounded by a circular drainage system 15 miles (24 kilometers) in diameter that marks the outer ring of the crater. Gosses Bluff has been the subject of intensive geological and geophysical scientific study and is deeply significant to the Western Arrernte Aboriginal people who own the Tnorala Conservation Reserve that contains the crater.<jupyter_code>m3 = gis.map("Gosses Bluff", 10)
m3<jupyter_output><empty_output><jupyter_text>![m3](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_03.PNG)<jupyter_code>m3.add_layer(extract_stretch([6, 3, 0]))<jupyter_output><empty_output><jupyter_text>Exumas, BahamasThe Exumas are an archipelago of 365 cays and islands, beginning just 35 miles southeast of Nassau. In clear water, Landsat sensors can penetrate nearly 100 feet (30m).The water is so clear and shallow in this area that underwater features are easily distinguished. Green vegetation appears red.<jupyter_code>m4 = gis.map("Great Exumas, Bahamas", 11)
m4<jupyter_output><empty_output><jupyter_text>![m4](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_04.PNG)<jupyter_code>m4.add_layer(extract_stretch([5, 3, 0]))<jupyter_output><empty_output><jupyter_text>Mexico City, MexicoMexico City, the capital city of Mexico, is situated on a highland plateau that is 1.5 miles above sea level (7,350 feet). The greater Mexico City area is home to over 21 million people.Short-wave Infrared with DRA (7,6,4): This band combination is used so that green vegetation appears green in the image.<jupyter_code>m5 = gis.map("Mexico City", 10)
m5<jupyter_output><empty_output><jupyter_text>![m5](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_05.PNG)<jupyter_code>m5.add_layer(extract_stretch([6, 5, 3]))<jupyter_output><empty_output><jupyter_text>Central Saudi ArabiaCenter-pivot irrigation agriculture in Saudi Arabia is used to grow crops such as wheat. The irrigation systems extend beyond the image areas throughout the Buradah-Riyadh region of Saudi Arabia. Agriculture with DRA (6,5,2): Green vegetation appears green in this band combination.<jupyter_code>m6 = gis.map("<NAME>, Saudi Arabia", 12)
m6<jupyter_output><empty_output><jupyter_text>![m6](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_06.PNG)<jupyter_code>m6.add_layer(extract_stretch([5, 4, 1]))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0748006379585327, 'fraction_numerical': 0.021212121212121213, 'mean_word_length': 5.838604143947656, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, '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': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '181536', 'license': 'Apache-2.0', 'n_tokens_mistral': 2014, 'n_tokens_neox': 1840, 'n_words': 675, 'path': 'samples/02_power_users_developers/tour_the_world_with_landsat_imagery_and_raster_functions.ipynb', 'repo_name': 'nitz21/arcpy', 'size': '6286'}