{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tour the World with Landsat Imagery and Raster Functions\n", "\n", "This 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.\n", "\n", "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.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Landsat imagery\n", "\n", "ArcGIS 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:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from arcgis.gis import GIS" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from arcgis.raster.functions import *" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "gis = GIS()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "landsat_item = gis.content.search('\"Landsat Multispectral\"', 'Imagery Layer')[0]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "
\n", " \n", " \n", " \n", "
\n", "\n", "
\n", " Multispectral Landsat\n", " \n", "
Landsat 8 OLI, 30m Multispectral 8 band scenes with visual renderings and indices. Updated daily. Based on the Landsat on AWS collections.Imagery Layer by esri\n", "
Last Modified: December 07, 2016\n", "
0 comments, 70,741 views\n", "
\n", "
\n", " " ], "text/plain": [ "" ] }, "execution_count": null, "metadata": {}, "output_type": "execute_result" } ], "source": [ "landsat_item" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "landsat = landsat_item.layers[0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Raster processing\n", "\n", "The 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." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def extract_stretch(bandids):\n", " return stretch(extract_band(landsat, bandids),\n", " stretch_type='PercentClip',\n", " min_percent=2, \n", " max_percent=2,\n", " dra=True, \n", " gamma=[0.8,0.8,0.8])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Cambridge Gulf, Australia\n", "\n", "Cambridge 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.\n", "\n", "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.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from arcgis.geocoding import geocode\n", "area = geocode('Cambridge Gulf')[0]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1378348d74f548a28b9cf6a09bb58b8e" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m = gis.map(area, 10)\n", "m" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![m](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_01.PNG)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m.add_layer(extract_stretch([5, 4, 1]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Eye of the Sahara, Mauritania\n", "\n", "The 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.\n", "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." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "62aeee5af9304b37ab42980e29c5852f" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m2 = gis.map(\"Guelb Er Richat\", 11)\n", "m2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![m2](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_02.PNG)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m2.add_layer(extract_stretch([6, 3, 1]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Gosses Bluff, Australia\n", "\n", "In 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." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5dfa7fc57363430495696106cdd9775a" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m3 = gis.map(\"Gosses Bluff\", 10)\n", "m3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![m3](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_03.PNG)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m3.add_layer(extract_stretch([6, 3, 0]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exumas, Bahamas\n", "\n", "The 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).\n", "\n", "The water is so clear and shallow in this area that underwater features are easily distinguished. Green vegetation appears red." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7fdf8d1bd5d0462db58e717ea55b7a6d" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m4 = gis.map(\"Great Exumas, Bahamas\", 11)\n", "m4" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![m4](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_04.PNG)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m4.add_layer(extract_stretch([5, 3, 0]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Mexico City, Mexico\n", "\n", "Mexico 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.\n", "\n", "Short-wave Infrared with DRA (7,6,4): This band combination is used so that green vegetation appears green in the image." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d03def05eb3c41e89ab5d6eccd5653d0" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m5 = gis.map(\"Mexico City\", 10)\n", "m5" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![m5](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_05.PNG)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m5.add_layer(extract_stretch([6, 5, 3]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Central Saudi Arabia\n", "\n", "Center-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.\n", " \n", "Agriculture with DRA (6,5,2): Green vegetation appears green in this band combination." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "58dcdd160467401ebbb0d33640a8b6dc" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "m6 = gis.map(\"Ash Simasiyah, Saudi Arabia\", 12)\n", "m6" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![m6](http://esri.github.io/arcgis-python-api/notebooks/nbimages/06_Landsat_Points_of_Interest_06.PNG)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "m6.add_layer(extract_stretch([5, 4, 1]))" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.3" }, "widgets": { "state": { "3a0097cac2db43e6ae119dc3beca198a": { "views": [ { "cell_index": 17 } ] }, "46caaf459a804397937fd357586f5252": { "views": [ { "cell_index": 20 } ] }, "574edeb6dcbd4411a330e129562f2e39": { "views": [ { "cell_index": 10 } ] }, "72b295fd27e14c30a242249a3db2e770": { "views": [ { "cell_index": 14 } ] }, "e1b0fb7e736b44268f47df6089094308": { "views": [ { "cell_index": 23 } ] }, "ecc86b833fb847fc8a288331829f7a94": { "views": [ { "cell_index": 26 } ] } }, "version": "1.2.0" } }, "nbformat": 4, "nbformat_minor": 2 }