canopy:tutorial
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
canopy:tutorial [2020-03-05 05:28 am] – hcho | canopy:tutorial [2020-04-19 08:49 pm] (current) – hcho | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== CanoPy tutorial ====== | ====== CanoPy tutorial ====== | ||
- | [[CanoPy:]] is the Python module for the [[:GFC canopy assessment|Georgia Canopy Analysis 2009 project]] sponsored by the Georgia Forestry Commission (GFC). For further information about this project, please refer to the [[CanoPy:]] page. | + | [[CanoPy:]] is the Python module for [[:GFC canopy assessment|the Georgia Canopy Analysis 2009 project]] sponsored by [[http:// |
- | This document explains detail steps for assessing canopy using the [[CanoPy:]] module and a provided sample data set. For technical details, please read the [[technical manual]]. | + | This document explains detail steps for assessing canopy using the [[CanoPy:]] module and a provided sample data set. To learn more about this module, please read the [[user manual]]. For technical details, please read the [[technical manual]]. |
===== Authors ===== | ===== Authors ===== | ||
- | * Owen Smith | + | * [[:Owen Smith]] |
===== Requirements ===== | ===== Requirements ===== | ||
Line 14: | Line 14: | ||
* ArcPy | * ArcPy | ||
* Python 2 standard module: os | * Python 2 standard module: os | ||
- | * Feature Analyst(tm) by the Textron Systems | ||
- | * Automated Feature Extraction (AFE) models trained using Feature Analyst | ||
We are currently planning on developing a fully open source solution without using ArcGIS and Feature Analyst. | We are currently planning on developing a fully open source solution without using ArcGIS and Feature Analyst. | ||
+ | ===== Sample data set ===== | ||
{{ : | {{ : | ||
- | <todo @owen> | + | The sample data will contain 3 folders titled ‘naip’, ‘data’, and ‘Outputs’. The ‘data’ folder contains the Georgia physiographic regions shapefile, the NAIP Quarter Quad (QQ) polygon shapefile in addition to the TIFF file which will be used for snapping. The ‘naip’ folder will contain 4 input QQ NAIP tiles that form a 2 x 2 area. The ‘Outputs’ folder contains the outputs that are created by Textron’s Feature Analysis software for each NAIP QQ in the sample dataset. This is included as this tutorial |
+ | |||
+ | ===== Steps ===== | ||
+ | |||
+ | - Either clone the repository using Git in the terminal with the below code < | ||
+ | git clone https:// | ||
+ | </ | ||
+ | * If you download the .zip file you will first need to unzip the file. It will be named ‘canopy-master’, | ||
+ | - Download the CanoPy | ||
+ | - Make a copy '' | ||
+ | - Edit the new '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | * This will allow CanoPy | ||
+ | - Open a new ArcMap 10.x document. | ||
+ | - Add the following files from the sample data folder to ArcMap. | ||
+ | - Physiographic_Districts_GA.shp | ||
+ | - naip_ga_2009_1m_m4b.shp | ||
+ | * You may notice these are the '' | ||
+ | - Open the Python window under the geoprocessing pane located on the top bar within ArcMap. | ||
+ | - After the Python window is open you must import the CanoPy module for ArcMap to be able to use its functions. To accomplish this use the following code. <code python> | ||
+ | import sys | ||
+ | sys.path.append(' | ||
+ | import canopy | ||
+ | </code> | ||
+ | - Most functions in CanoPy only contain one parameter, '' | ||
+ | canopy.assign_phyregs_to_naipqq() | ||
+ | </ | ||
+ | * After it is finished the '' | ||
+ | * The secondary purpose of '' | ||
+ | - Next you will assign the phyreg_ids, which in our case will be:<code python> | ||
+ | phyreg_ids = [3] | ||
+ | </ | ||
+ | * If more regions were able to process you would assign those regions as such: <code python> | ||
+ | phyreg_ids = [3, 7, 15] | ||
+ | </ | ||
+ | - Next you will reproject all input NAIP tiles to the projection specified by the '' | ||
+ | canopy.reproject_naip_tiles(phyreg_ids) | ||
+ | </ | ||
+ | * Reprojected tiles with the suffix ‘rm_’ will be saved to '' | ||
+ | - The reprojected tiles in the Inputs folder will be used in as the inputs with Textrons Feature Analyst, however we are skipping that step, so you will want to move the '' | ||
+ | * The folder structures should now look like this:{{ : | ||
+ | - After the ' | ||
+ | canopy.convert_afe_to_canopy_tiff(phyreg_ids) | ||
+ | </ | ||
+ | - '' | ||
+ | * Ensures all tiles are TIFF files with the values of 0 & 1. Files have prefix of ' | ||
+ | - '' | ||
+ | * Clips all tiles to the outline of their QQ to remove all edge artifacts (errors along edge of file) and make mosaicing more accurate. Files have prefix of ' | ||
+ | - '' | ||
+ | * Mosaics all clipped tiles to the shape of their physiographic region and clips the mosaic to the physiographic region boundaries. | ||
+ | - After running the final wrapper function the outputs folder will contain all intermediate and final 2-bit output Canopy TIFFS. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ |
canopy/tutorial.1583411300.txt.gz · Last modified: 2020-03-05 05:28 am by hcho