topssasa.blogg.se

Ucla geo 5 gillespie midterm
Ucla geo 5 gillespie midterm






ucla geo 5 gillespie midterm

lyr file #set parameters #vector = arcpy.GetParameterAsText(0) SymbologyLayer = r"D:\My Documents\GlobCover_Legend.lyr" # comment out or delete this line if there is NO symbology. To fix this, manually remove those polygons using ArcMap ''' #- #import system module import arcpy, osįilepath = r"D:\My Documents\RASTER_EXTRACTER" # change path to workspace folderĪrcpy.ImportToolbox( r"D:\My Documents\SplitLayerByAttributes.tbx") # change path to location of "Split Layer By Attributes" toolbox.

UCLA GEO 5 GILLESPIE MIDTERM CODE

If code crashes while running, it is possible that polygons exist in the vector file that do not have corresponding raster data to extract. If code returns a 'NoneType' error, close all files and re-run code (this error is due to the code's use of the custom tool "SplitLayerByAttributes") 2. change the ten places in code that have a comment on the right hand side (indicated by ' # ') 2. Code Requirements: This code requires the user to have Python 2.6 for ArcGIS 10 (or above) installed on computer This code uses a custom python script called "Split Layer By Attributes" that can be downloaded from: This code requires ArcGIS Spatial Analyst Extension Code Usage Guide : 1. Final output is a folder with masked raster subsets. Appends extracted raster files with "Value", "Area", and "Percent" fields. Uses individual shapefiles to extract raster data by mask. '''BatchRasterExtractor.py Author: Kelsey Kaszas Dept of Geography and Environmental Studies University of California, Los Angeles, USA Special Thanks to Jida Wang Date created ApModified JPurpose: Converts each shape in a feature class into a separate shapefile. example = shapefile of all countries in world.To fix this, manually remove those polygons in ArcMap. If code crashes while running, it is possible that polygons exist in the vector file that do not have corresponding raster data to extract.

ucla geo 5 gillespie midterm

(This error is due to the code's use of the custom tool "Split Layer By Attributes"

  • If code returns a 'NoneType' error, close all files (including ArcMap, IDLE and shell) and re-run code.
  • Change / modify the ten lines in the code that have a comment on the right hand side in green (indicated by ' # ' ).
  • Copy and past code below into Python IDLE window and save as a.
  • User must have licensing for ArcGIS Spatial Analyst Extension. A custom python script called "Split Layer by Attributes" is used in this code, it must be downloaded for this code to work from this link.

    ucla geo 5 gillespie midterm

    To use this code, the user must have Python 2.6 for ArcGIS 10 (or above) installed. Fourth, statistics are calculated for each raster subset, Area and Percentage fields are appended to the attribute tables of each subset. Third, each polygon is masked on top of the raster and used to extract a subset of the raster. Second, a split by attribute tool is used to export each polygon into a separate shapefile. First, the user inputs the vector file and raster file of interest.

    ucla geo 5 gillespie midterm

    The Batch Raster Extractor is meant to provide a standard and repeatable way to extract raster data using the polygons of a vector file. In order to do a temporal comparison, a separate code would be required to draw comparison statistics. This is accomplished by using the polygons to extract pixel data from the GLOBCOVER raster. To help solve this research question, this code produces statistics of landcover area (km2) and percentage land cover (%) for polygons (ie eco-regions, countries and protected areas). A new data set is created every few years and Gillespie's research goal is to compare eco-regions, countries and protected areas over time to look for forest degradation. The data is a satellite imagery raster that has been classified into landcover types. The data set being used is called the GLOBCOVER project and it is created by the European Space Agency (ESA). Gillespie's research involves identifying global biodiversity hotspots that have seen significant landcover change. Thomas Gillespie of the UCLA Geography Department, however the code can be used for a variety of applications.ĭr. The purpose of the code is intended for research conducted by Dr. This code was created during a Programming and Development for GIS course at UCLA during Winter 2012.








    Ucla geo 5 gillespie midterm