Pages

Monday, March 13, 2017

Exercise 5: Data Downloading, Interoperability, and Working With Projections in Python

Introduction

The goal of this assignment was to become familiar with downloading data from a multitude of internet sources, importing the data into ArcGIS applications, and automating the projection of the data using python. This data collection and preparation will be used in a latter assignment which will focus on frac sand mining in Trempealeau County.

Methods

In order to ensure an organized and concise method of downloading data from multiple sources, a temporary folder was created in which all of the .zip files downloaded would be stored until unzipped into the assignment's working folder. The data for the digital elevation model (DEM) and the land cover came from the USGS National Map. The data for the cropland map was found in the USDA Geospatial Gateway. The data for the soil survey was obtained from the USDA NRCS Soil Survey. Lastly, the Trempealeau County database was derived from the Trempealeau County Land Records Department.

Once the data was downloaded and unzipped into the working folder, python scripter was used to automate projecting the shapefiles and rasters into the same projection (NAD 83 Trempealeau County US Feet) and any shapefiles or rasters that were not just the county already were clipped.

 #-------------------------------------------------------------------------------
# Name:        Ex 5
# Purpose:      Project, clip, and load data into geodatabase
#
# Author:      Zach Miller
#
# Created:     08/03/2017
#
#-------------------------------------------------------------------------------

#import spatial settings
import arcpy
from arcpy import env
from arcpy.sa import*
arcpy.CheckOutExtension("spatial")

#set workspace
arcpy.env.workspace = "Q:\StudentCoursework\CHupy\GEOG.337.001.2175\MILLERZM\Ex5\Work"
arcpy.env.overwriteOutput = True
print "{}".format(env.workspace)

#get a list of rasters
listOfRasters = arcpy.ListRasters()
print "{}".format(listOfRasters)

#loop through the rasters
for raster in listOfRasters:
    #define the outputs
    rasterOut = "{}_Out.tif".format(raster)
    rasterExtract = "{}_Extract.tif".format(raster)

    #project the rasters
    arcpy.ProjectRaster_management(raster, rasterOut, "Q:\StudentCoursework\CHupy\GEOG.337.001.2175\MILLERZM\Ex5\TrempWebDATA.gdb\Boundaries\County_Boundary")

    #Extract the raster and copy the raster into the geodatabase
    outExtractByMask = ExtractByMask(rasterOut, "Q:\StudentCoursework\CHupy\GEOG.337.001.2175\MILLERZM\Ex5\TrempWebDATA.gdb\Boundaries\County_Boundary")
    outExtractByMask.save(rasterExtract)
    arcpy.RasterToGeodatabase_conversion(rasterExtract, "Q:\StudentCoursework\CHupy\GEOG.337.001.2175\MILLERZM\Ex5\Work")
    print "Raster to Geodatabase conversion {} successful".format(rasterExtract)

print "Script is complete"

Next, the accuracy of the data was determined by looking at the metadata of the downloaded datasets.


Lastly, three maps were made to show the landcover, cropland, and DEM of Trempealeau County.

Results




Conclusions

After making the maps and reviewing the accuracy of the data, it is clear that there is quite a bit of information missing. In the instance of this assignment, the sources used to collect the data are fairly reputable and credible. Time-wise the lack of temporal information might be critical in some situations but for the context of this assignment, again, it's not. As far as the usability of these maps, the landcover is relatively useful. For the croplands map, there is an overwhelming amount of classified values and would require a much smaller scale to really be effective.

No comments:

Post a Comment