ENV 761 (Fay) - Conservation GIS

Exercise: Organizing Spatial Data

Exercise: Organizing Spatial DataOverviewThe ScenarioStep 1: Create your project workspace Step 2. Organizing and preparing data in your workspaceStudy AreaASTER Elevation DataLand cover dataLand coverTesting your workspaceRecap / What's next

Overview

All spatial analyses require data and often generate a lot of temporary files. You'll benefit by being organized with your data and maintaining documentation on what is what in among your files.

In this exercise, we review some best practices for managing spatial data for a project. These aren't hard and fast rules in that you can still get valid results without following these guidelines, but based on my years of experience, I found these tips have saved me gobs of time.

We'll explore these best practices in the context of a fabricated project. Here, I provide you with some datasets in various formats, scales, and projections. Some are well documented; others are not. Your task will be to prepare a workspace for analysis. In subsequent tutorials, we will explore where you might turn when you aren't given the source data but rather have to find them yourself. From there we'll review basic principles of cartography and best practices for presenting your results in map, tabular, and text format.


The Scenario

Congratulations on your new job as GIS specialist for the Malagasy Conservation Group (MGC)! Your first assignment is to assist in planning the route of some newly acquired un-manned aerial vehicles (UAVs or drones) over Masoala National Park in the NE corner of Madagascar. As yet, the specific objective of the analysis is not known, but you are told to prepare the data for whatever may be asked of you.

Your predecessor has left you all the data you need, but not in a very organized fashion and with varying levels of documentation. These data sets can be found here: https://env761.github.io/ConsGIS/DATA/Lab0_Data.zip. Your task will be to organize these files and prepare an ArcMap workspace so that you are up and running when the drone team comes to visit in the next few days.

The following steps will guide you through this process. At the end of the tutorial you will have a single project folder containing all the data you need for the analysis as well as an ArcMap document and toolbox with the proper environment settings applied. This project folder can be backed up or moved to different locations while still retaining all the data and formatting required to allow you to jump right back into the analysis.


Step 1: Create your project workspace

The first step in any geospatial project you begin should be to create a workspace that will keep your files organized. Geospatial analysis is notorious for making many, many intermediate datasets, themselves made up of multiple files, which can easily clutter up your machine. ArcGIS Pro has some mechanisms for handling this, but we recommend a few additional steps prior to creating your ArcGIS Pro project that will help in keeping your workspace organized. These steps involve creating a folder structure consisting of a project or root folder in which everything else is stored, and within this folder are four subfolders - data, docs, scratch, and scripts - each with a specific purpose. Once that is complete, we'll create a new ArcGIS Pro project in the root folder and our workspace components will be complete. In the end, it will have the following structure:

  1. Project folder and sub-folders Using Windows Explorer, create a project folder (we'll call it Lab0_Masoala for now) and the four subfolders for your Masoala project. Always be sure that no spaces occur in the project folder name or anywhere in the path to this folder. Spaces in file, folder, and path names can cause errors when certain ArcGIS tools are run. Use underscores if you need (e.g. "My_project", not "My project"), but avoid spaces and other odd characters.

  2. The readme.txt file Create a new text named README.txt in your project folder file. Use this file to store a few comments about the workspace - enough to briefly explain what the project is about, to differentiate it from other workspaces in case you or someone else revisits this workspace from a long hiatus. Include your name and the date.

  3. The ArcGIS Pro project and it's components Open ArcGIS Pro and create a new blank project. Let's name it Masoala and save it in a new folder on your class drive/ Be sure the option to create a new folder for the project is NOT checked. ​

    CreateWorkspace

    When you do this, ArcGIS Pro creates a new project file (Masoala.aprx, a default toolbox (Masoala.tbx), and a default geodatabase (Masoala.gdb).

  4. Create a scratch geodatabase In the Scratch folder, create a scratch geodatabase called scratch.gdb. You'll have to do this from within ArcGIS Pro's catalog pane by right-clicking on the Databases option and selecting New File Geodatabase.

    • This scratch geodatabase is useful when you want an intermediate dataset to be stored within a geodatabase, e.g., when you want feature area and/or length to be automatically created.
  5. Set geoprocessing environment variables Finally, you'll want to set your geoprocessing environment variables - at least the workspace variables - for your project. This is done in the Analysis menu, from the Environments tab.

    • Set your Current Workspace to the Data folder.
    • Set your Scratch Workspace to your the Scratch folder.

    Depending on other needs of your analysis, you might want to set other environment variables, but this will do for now.

→ In the end your workspace should look like this. (You may have to refresh your Lab0_Masoala folder in ArcGIS...)

WorkspaceSnapshot

 

You now should have your workspace all set and should be ready to begin your analysis. Getting in the habit of starting each project by creating a workspace in this format will likely save you a lot of time and headache in the long run. You can view an example of how your workspace should look by expanding the ExampleWorkspace_Masoala.zip file.


Step 2. Organizing and preparing data in your workspace

With our workspace set, we can organize the data we need to do our analysis. All input data sets should be stored in your Data folder, but you can add subfolders if you wish to further organize your data, e.g. by source, date, type, or whatever.

Often, you will need to preprocess your data sets before you actually do any analysis with them. This can involve uncompressing files, converting formats, defining projections, reprojecting data, etc. While you will definitely want to keep the processed files, it's up to you whether you want to retain the original files in your workspace after pre-processing them for analysis. Usually, if the data sets can be easily obtained again, if necessary, and/or if they consume valuable disk space, I will delete them and just keep the data in the format I need for processing.

Study Area

The MCG has provided two geospatial data files delimiting the study extent. These are found in the MCGdata folder (zipped as MCG.zip on Sakai). Your first task is to prepare these files and add them to your map. Also in this folder is a README_MCG.txt, which contains information about these files.

You've just discovered that these two feature classes do not have any defined projections. The metadata file indicates these coverages use the "Laborde" projection, but since the coverages themselves have no defined coordinate system, ArcMap has no way of knowing this. So, the next step is to define the projection for these files.

ASTER Elevation Data

In addition to the park boundary and the quadrat grid, the drone team will also need an elevation and a land cover dataset. ASTER elevation data were given to us in their raw downloaded form as 4 zip files, each comprising 1 x 1° tiles of 30 arc-second DEMs. In this section, we will uncompress the files, mosaic the tiles into a single dataset, and reproject the data to match the Laborde projection used above.

We now have ASTER DEM data (and their corresponding quality control rasters) for the extent and in the coordinate system of our analysis. To conserve space, we'll delete the original GeoTIFF files and their compressed counterparts. In the end you should only have 8 files in your folder.

Land cover data

Land cover

Testing your workspace


Recap / What's next

At the end of the exercise you have a tidy, efficient workspace ready for analysis. All the data is organized and in a single projection, which will greatly simplify analysis and minimize errors. In later exercises we will explore how you might assemble a dataset when the data are not simply given to you.