Using a GIS to Calculate Area of Occupancy Part 1: Creating a Shapefile Grid By Ryan Elliott California Natural Diversity Database, A NatureServe network program December 2008 This document describes the first step to be taken when using a GIS to calculate Area of Occupancy for NatureServe conservation status assessments. More specifically, the instructions below describe how to create a GIS shapefile that is a grid of cells with uniform size by first creating a raster, then converting the raster s cell boundaries into a polyline shapefile, and finally, converting the polyline shapefile to a polygon shapefile. In order to calculate Area of Occupancy for conservation status assessments, you will generally need a polygon shapefile with 2 km x 2 km grid cells that covers the area of interest. This grid can be saved and used for reference later; you only need to create it one time. Once the grid has been created, it can be used in the process described in the document Using a GIS to Calculate Area of Occupancy Part 2: Automated Calculation of the Area by Erin Prescott. Questions and further information related to the instructions that follow can be directed to Ryan Elliott (relliott@dfg.ca.gov; California Dept of Fish & Game Biogeographic Data Branch, 1807 13 th Street Suite 202, Sacramento, CA 95814, USA). A basic knowledge of the ESRI ArcGIS software and associated tools is required to use these instructions. Note that these instructions, developed in 2008, utilize ESRI ArcMap 9.2, with the Spatial Analyst Extension enabled. As applications are constantly evolving, the applicability of this documented process may change. Please check the NatureServe website pr contact the author for the latest edition of instructions. Software Requirements: ESRI ArcMap (instructions developed for version 9.2) Spatial Analyst Extension (however, if not enabled, an alternative process for developing a shapefile using the fishnet tool is provided at the end of these instructions) Coordinate system: 1. Confirm that you have a coordinate system and projection that corresponds to your area of interest in the world. To create the grid shapefile, your data frame must use a projected coordinate system with meters as its unit of measurement (for example, in California we use California Teale Albers). You should be able to find a similar projection for the area of your NatureServe network program by browsing the projections that come with ArcGIS. The spatial extent can be determined by looking at 1
the properties of a shapefile in the coordinate system you choose that has the same extent as your area of interest. 2. If you do not have such a shapefile, you can create one this way: a. Add a shapefile to your project that covers your whole area of interest. b. Go to View Data Frame Properties then open the Coordinate System tab. c. Choose the coordinate system you want to use. d. Right-click on the shapefile, go to Data Export Data e. Select all features for export. f. Select the data frame for the coordinate system. g. Specify a location where the shapefile will be saved to your computer. h. Hit OK. 2
3. When the export is complete you will be asked if you want to add the exported data to your map. Select Yes. You can now right-click on the layer, go to Properties and see the spatial extent. Create a grid using Spatial Analyst: NOTE: If you do not have the Spatial Analyst Extension enabled, skip to the section Alternative process for creating a shapefile using fishnet tool at the end of this document. 1. To create your raster (grid), first open the Create Constant Raster tool in ArcToolbox Spatial Analyst Tools Raster Creation Create Constant Raster. 2. Enter data as follows: a. Specify a file name and location in the output raster field where you would like the raster to be saved on your computer. b. The constant value will be 1. c. The output data type will be INTEGER. d. The output cell size is the size of each raster grid cell in the units of the coordinate system. Set the grid size to 2000 to create a grid of cells that are 2 kilometers on a side, or 1000 for 1 km grid cells. e. The output extent will be the same as the extent of the area of interest, pulled from the shapefile properties mentioned earlier. Y Maximum is the top extent, Y Minimum is the bottom, X Minimum is the left, and X Maximum is the right value. 3
3. Hit the Environments button at the bottom of the dialog. The Environment Settings dialog will appear. 4. Click on the little down arrows to the left of General Settings to expand the settings section, and select Same as Display for the Output Coordinate System. 4
5. Hit OK to close the Environment Settings dialog. 6. Hit OK to run the Create Constant Raster Tool. After you run this tool you should have a raster that covers your area of interest. It will probably just appear as one giant black rectangle. 7. Open the Raster to Polyline tool in ArcToolbox Conversion Tools From Raster Raster to Polyline. 8. Drag and drop your new raster from the table of contents in your ArcMap project to the Input raster box. 9. Enter data as follows: a. Select VALUE for the field box. b. Enter a file name and location in the output polyline features box where a line shapefile will be saved to your computer. c. The background value will be zero. d. The minimum dangle length is not needed. 5
e. You can leave the simplify polygons box checked. 10. Hit OK. After you run the tool you should have a polyline shapefile that shows the boundaries of the 2 kilometers cells in your area of interest. 11. Open the Feature to Polygon tool in ArcToolbox Data Management Tools Features Feature to Polygon. 12. Drag your polyline layer into the Input Features box. It will be automatically added to the grid just below that box automatically. 13. Enter a location and filename where a new polygon shapefile will be saved to your computer in the output feature class box. 6
14. Leave the other boxes with their default values and hit OK. Relax, as it may take a few minutes for this tool to run. You will need to add a Grid ID field to your shapefile to keep track of a unique identifier for each cell. ArcMap will have given each polygon a unique FID at this point. FIDs, however, cannot reliably be used to identify a cell at a particular location since they are recalculated each time you run a spatial tool. This means that while running tools in future analysis, you will likely end up with polygon cells stacked on top of one another. Each of these polygons will have its own FID, even though they may refer to exactly the same place on the Earth. It is at this point that a Grid ID field should be added to the shapefile, as all portions of the area of interest are currently occupied by single cells, each with its own unique FID. The sequence of FIDs will start with a zero. By adding 1 to each FID we can create a serial number, of sorts, for each cell. 7
15. To add a Grid ID field, open the attribute table of the polygon shapefile by hitting the Options button and then selecting Add Field 16. Enter data as follows: a. Enter Grid_ID in the name field. b. Set the type as Long Integer. c. Leave the precision as zero. 8
The Grid_ID field will now appear in the attribute table. 17. Right-click on the top of the Grid_ID column and then select Field Calculator 9
18. Create formula for Grid_ID = box: a. Double-click on FID in the top box. b. [FID] will then appear in the lower box. c. Hit the plus sign on the right side of the dialog. d. Type the number 1. The resulting formula should be Grid_ID = [FID] + 1 19. Hit OK. Your shapefile is now complete. You should zoom in to about 1:15,000 and take a look at the size of the cells, making sure the squares are 2 kilometers on each side. Alternative process for creating a shapefile using fishnet tool: NOTE: If you do not have the Spatial Analyst Extension enabled, substitute the following process for the first ten steps of the instructions above. 10
1. Open the fishnet tool in ArcToolbox Data Management Tools Feature Class Create Fishnet. 2. When the tool opens, click the Show Help button and use the instructions for creating a grid that are displayed. 3. Once you have created a shapefile using the fishnet tool, finish the process of creating a grid beginning with step 11 above, which uses the Feature to Polygon tool. 11