{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "86ba7235", "metadata": {}, "source": [ "# Raster Analysis Basics\n", "\n", "## 1. Raster Properties \n", "\n", "\n", "\n", "### 1.1 What is raster data?\n", "\n", "In its simplest form, a raster consists of ***a matrix of cells*** (or pixels) organized into rows and columns (or a grid) where ***each cell contains a value*** representing information, such as temperature. Raster grids can be outputs from raseter analysis, digital aerial photographs, imagery from satellites, digital pictures, or even scanned maps." ] }, { "attachments": {}, "cell_type": "markdown", "id": "2750861c", "metadata": {}, "source": [ "\n", "\n", "```{admonition} Single-band:\n", "Temperature, elevation, soil pH value\n", "```\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/raster_colormap.gif)\n" ] }, { "attachments": {}, "cell_type": "markdown", "id": "bffe114d", "metadata": {}, "source": [ "\n", "\n", "```{admonition} RGB composite:\n", "Time series, satellite imagery\n", "```\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/rgb_composite.gif)\n" ] }, { "attachments": {}, "cell_type": "markdown", "id": "63dd5332", "metadata": {}, "source": [ " \n", "\n", "| single-band satellite image | 3-band RGB composite satellite image |\n", "|:----------------------------------:|:------------------------------------------:|\n", "| ![grayscale](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/grayscale.png) | ![rgb_composite](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/rgb_composite.png) |\n" ] }, { "cell_type": "markdown", "id": "23929ae4", "metadata": {}, "source": [ "### 1.2 List Rasters" ] }, { "cell_type": "code", "execution_count": 1, "id": "fec3de40", "metadata": {}, "outputs": [], "source": [ "import arcpy\n", "\n", "gdb_worksp = r\"..\\data\\class_data.gdb\"\n", "arcpy.env.workspace = gdb_worksp" ] }, { "cell_type": "code", "execution_count": 2, "id": "fde39526", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['dem', 'habitat']" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rasters = arcpy.ListRasters()\n", "rasters" ] }, { "attachments": {}, "cell_type": "markdown", "id": "d1926abc", "metadata": {}, "source": [ "## 2. Run Raster Tools in ArcGIS Pro\n", "\n", "### 2.1 [Euclidean distance](https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/euclidean-distance.htm)\n", "\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/eucdist.gif)\n", "\n", "### 2.2 [Slice](https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/slice.htm)\n", "\n", "\n", "\n", "``` {admonition} Slice method- Natural Breaks:\n", "Natural Breaks classes are based on natural groupings inherent in the data.Class breaks are identified that best group similar values and that maximize the differences between classes. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information.\n", "```\n", "\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/slice.gif)\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/naturalbreaks.png)\n", ">" ] }, { "cell_type": "markdown", "id": "dfd61560", "metadata": {}, "source": [ "### 2.3 [Reclassify](https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/reclassify.htm)\n", "- RemapValue\n", "- RemapRange" ] }, { "cell_type": "markdown", "id": "43078dc0", "metadata": {}, "source": [ "### 2.4. [Raster Calculator](https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/raster-calculator.htm)\n", "\n", "- [Map Algebra Expression](https://pro.arcgis.com/en/pro-app/help/analysis/spatial-analyst/mapalgebra/working-with-operators.htm)" ] }, { "cell_type": "markdown", "id": "1d74532d", "metadata": {}, "source": [ "## 3. Raster Processing [Environment](https://pro.arcgis.com/en/pro-app/latest/tool-reference/environment-settings/an-overview-of-geoprocessing-environment-settings.htm)\n", "\n", "General info about [Geoprocessing environment settings](https://pro.arcgis.com/en/pro-app/latest/tool-reference/environment-settings/what-is-a-geoprocessing-environment.htm).\n", "\n", "\"**MESC**\" are the four most important environment settings for raster analysis." ] }, { "attachments": {}, "cell_type": "markdown", "id": "f2ae3ce8", "metadata": {}, "source": [ "```{admonition} Mask:\n", "set by feature class or data set\n", "```\n", "\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/mask.gif)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "08dda03b", "metadata": {}, "source": [ "```{admonition} Extent:\n", "set by feature class, raster dataset, or coordinates of the sidees of the rectainge (Left, Right, Top, and Bottom).\n", "```\n", "\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/extent.png)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "434d8809", "metadata": {}, "source": [ "```{admonition} Snap raster:\n", "set by a raster dataset.\n", "```\n", "\n", "| no snapping raster | with snapping raster |\n", "|:----------------------------------------:|:----------------------------------------------:|\n", "| ![snap_left](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/snapRaster_left.png) | ![snap_right](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/snapRaster_right.png) |" ] }, { "attachments": {}, "cell_type": "markdown", "id": "efbbba39", "metadata": {}, "source": [ "\n", "\n", "```{admonition} Cell size:\n", "set by a raster dataset or number.\n", "```\n", "\n", "![ ](https://raw.githubusercontent.com/chjch/LAA6656/master/tutorials/img/cellSize.gif)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "file_extension": ".py", "name": "python", "version": "3.9.11 [MSC v.1931 64 bit (AMD64)]" }, "vscode": { "interpreter": { "hash": "4512e868ce03776b2acb55696d863bcca535b363b5450b1af05055989d5d969c" } } }, "nbformat": 4, "nbformat_minor": 5 }