Tuesday, May 16, 2017

Post 6: Raster Modeling

Introduction
The goal of this lab was to apply raster tools in a real-world setting. The raster tools for this lab were used to find a suitable area for a new sand frac mine in Tremealeau County, WI. This project was split into two parts; first create a map that shows suitable/desirable areas for a sand frac mine and the other was to find areas that could be negatively impacted by a sand frac mine. The final product was a map that showed a range from the best to worst places to build a sand frac mine in Trempealeau County.

Methods
To find a suitable area for the mine, 5 factors were considered:
1. Geology
2. Land Use
3. Distance to Rail Terminals
4. Slope of the Land
5. Water Table Depth

The first step was to set the environmental settings for the map. The mask was set for the Trempealeau County boundary and setting the cell size to 30 meters. Most of the tools and operations were supposed to be done in Model Builder, however Model Builder was not working well, so this exercise was done without it.

The first map that was created was related to the geology of Trempealeau County. A geology map was provided for this lab to find the most suitable geology type for a sand mine. It was determined that the Wonewoc Formation and the Jordan Formation are the most suitable rock formations for a sand mine, so the geology feature class was reclassified to display only the Wonewoc and Jordan formations.

Next, a land cover feature class that was downloaded from the National Land Cover Database in an earlier exercise. This feature class was reclassified to create three ranks for the most suitable land covers to build a sand mine on. Any open water, wetlands, high intensity areas or forests were deemed the least suitable, so they were given the first ranking (1). Low intensity, shrub and scrub land covers were given the second ranking (2), because it would be easier to clear for a mine. The open spaces, barren land, hay, pasture and cultivated crop land covers were given the third rank (3). because they required the least amount of work to clear. Another land cover map was created with only two ranks: suitable land covers and unsuitable land covers.

Sand mine companies can save money transporting sand when it is close to a railroad terminal, so the Euclidian distance tool was used on a railroad terminal feature class. Then the reclassify tool was used to create rankings of suitability with the closest rank being 3 and the furthest being 1.

Slope is important when building any type of facility. A Trempealeau County DEM and the slope tool was used to calculate the slope of the county. The resulting slope map appeared very "spotty", so the block statistics tool was used to reclassify the cells in a 3x3 window to make slope look more uniform across the county. Then the reclassify tool was used to rank slope. 0-12% slope was deemed suitable (3), then 12.1-20% was next (2) and the rest was deemed unsuitable (1).

The sand is washed to remove small particles after it is mined, so having a mine near a water table that is close to the surface is beneficial. A TC water table elevation map was downloaded from the Wisconsin Geological Survey website. The water table elevation DEM was reclassified and ranked (1-3) so that the closer to the surface the water table was, the better.

By combining all of these maps, a suitable sand frac mine index was created that shows the most suitable areas in the county for a sand frac mine (Figure 1). This map was created by multiplying the previous maps in raster calculator tool.

There were 5 factors included for the second map to determine impact of a new sand frac mine:
1. Proximity to Streams
2. Prime Farmland
3. Proximity to Residential Areas
4. Proximity to Schools
5. Proximity to Wildlife Areas

To create a ranking system of proximity to streams a DNR-Hyo_flowline feature class from the Trempealeau County geodatabase was downloaded from the county website. Primary perennial streams and secondary perennial streams that flow over land were chosen for reclassification, because they are used the most by people and a sand mine could drastically change those important streams. Euclidean distance and reclassify were used to create rankings where the highest impact was closest to the streams (3) and areas of least impact of rivers were further away from the rivers (1).

Prime farmland was selected from a Prime_Farmland feature class in the TC gdb where Euclidean distance and reclassify were used to determine a ranking system where prime farmland was impacted the most (3) and away from the farmland was more ideal (1).

Next, residential areas were selected from the Zoning_Districts feature class in the TC gdb and made into a feature class. Euclidean distance was used to create a 640 meter "buffer" around all residential areas in Trempealeau County so that the sound and dust from the mine did not disturb those residential areas. Then the map was reclassified so that only residential areas (with the 640 meter buffer) showed. The same procedure was done with schools. A 640 meter "buffer" was created around schools in TC and everything outside was ranked as low impact. Wildlife areas are important in Wisconsin and should not be disturbed by any mines. A wildlife feature class was found in the TC gdb where areas of the highest impact were the wildlife areas (3), a 1500 meter buffer was placed around the wildlife areas (2), and everywhere outside of that was an area of low impact to wildlife. An extra map was created of TC using the viewshed tool. Using this tool, every area visible from a horse trail in TC was calculated to preserve the natural beauty of the trail and so that horses would not get spooked from a sand frac mine (Figure 2).

These maps were combined (excluding the viewshed map) to create an impact index (Figure 3). The maps were combined by adding them together with the raster calculator.

A final map was created by subtracting the impact index map from the suitable sand frac mine using the raster calculator (Figure 4). Reclassify was used to get rid of any negative values from subtraction.

Results
Figure 1. The suitable sand frac mine location map indicates that the most suitable areas for a mine is in southwestern/western Trempealeau County. This is due to the proximity to rail terminals, landcover, lack of slope, presence of a shallow water table. 
Figure 2. The viewshed tool shows all areas that can be seen from the horse trail using elevation from the DEM. 


Figure 3. The Prime Farmland map shows that most of the county is suitable for farming. Residential areas play a large role in the impact map.
Figure 4. The final map looks similar to the suitability map, however there are less areas that are suitable for the sand mine. Once again, southwestern/western TC look to be the best areas for a sand mine. There are some areas in northern TC that could also be suitable for a mine. 
Discussion
Raster analysis may have been one of the most useful exercises used in GEOG 337. Raster analysis plays a large role in deciding where to place many environment-changing industries. This lab proved that rasters are very important in GIS and that these tools provide invaluable abilities. The reclassify tool was important in this lab because it allowed for a ranking system, which is better than laying many clipped rasters over each other.

The viewshed tool was the only tool that did not seem to pertain to the lab, but it is still interesting to learn about. Raster analysis was one of the more exciting (and long) exercises of the course.

Friday, April 21, 2017

Post 5: Network Analysis of Sand Mining Trucks

Introduction
The goal of this project was to perform network analysis to calculate the impact of trucking sand from mines to rail terminals on local roads in Wisconsin. The weight of the trucks and the amount of traffic would cause damage to those roads and this network analysis approximated yearly costs for repairing those roads for each county. The number of trips and the costs associated with this project were purely hypothetical and should not be used for actual projects. This White Paper case study served as the background for this project. The network dataset was provided by ESRI street map USA and the rail terminals and sand mine locations were provided by the Wisconsin DNR.

Methods
The network analysis was completed in ESRI's ArcMap using model builder (Figure 1). Before using model builder the address field in the sand mines feature class was deleted to avoid errors within model builder. The first tool used in model builder was 'Make Closest Facility Layer' which used the streets network reference layer as the input. The 'Add Locations' tool was used to set the sand mines as incidents and the rail terminals as facilities. Next the 'Solve' tool was used to create the routes from the facilities to the incidents. In order to export the route to a feature class a 'Select' tool and a 'Copy Features' to export it to the geodatabase created for this project. The routes feature class was then projected to an appropriate coordinate system and then intersected with the Wisconsin counties feature class so that the routes can be separated into the different counties. The 'Summary Statistics' tool was used to create a table (Table 1) for the feature class which summed up the distance of each route in each county. The final tools used in model builder were 'Add Field' and the 'Calculate Field'. A field was created and calculated so that annual cost of impact on local roads from sand mining trucks was added to each county in the table. The field was named Sum_road_cost and the calculation used was SUM_Shape_Length x 0.000621371 x 100 x $0.022. The calculation kept in account the conversion from meters to miles. It was multiplied by 100 due to the trucks taking about 50 trips a year and accounting for the trip back. Once the model was run the table was created and joined with a Wisconsin counties layer so that the cost per county could be mapped.
Figure 1. Model builder was used to create the information used in this project.

Results
The resulting table displayed the name of each county with roads affected by sand mining trucks, the frequency, the total length of roads in meters and the total yearly cost in US dollars.
Table 1. The cost per year was relatively low because the cost per mile was hypothetical and relatively low.
The resulting map displayed the cost per county using graduated colors. The map also displayed the railroad terminals, the sand mines, the truck routes used to transport the sand and major roads in the region. 
Figure 2. The counties with that would need to pay the most are Chippewa, Barron and Eau Claire.
The costs were only calculated for Wisconsin counties. Most of these counties lay in western Wisconsin, because that is where most of the sand mines are. If every sand mine in Wisconsin was included in this map there would be much more, but this map displays only the mines without its own rail terminal. 

Conclusion
Sand mining in Wisconsin has a huge impact on the western Wisconsin economy. It is important when approving new sand mines the cost vs. benefit of that sand mine. GIS can be a useful tool to analyze different costs of having sand mines. This project can help make decisions to approve only new sand mines that lie on rail road terminals to avoid these costs for these counties.

Thursday, March 30, 2017

Post 3: Gathering Data

Introduction
The goal of this lab was to become familiar with a few sources for collecting data and to determine accuracy of the data collected. The data collected was for Trempealeau County, Wisconsin. A map of Trempealeau County was created using the land cover, crop cover and digital elevation model data gathered from these different resources (Figure 1). In addition, a table was created to display all the information about each dataset that was available to determine the accuracy of the data.

Methods
The data for this map were collected from various sources:

US Department of Transportation-Bureau of Transportation Statistics:https://www.rita.dot.gov/bts/sites/rita.dot.gov.bts/files/publications/national_transportation_atlas_database/index.html

United States Geological Survey-National Map Viewer: http://nationalmap.gov/about.html

USDA Geospatial Data Gateway:http://datagateway.nrcs.usda.gov/

Trempealeau County Land Records: http://www.tremplocounty.com/tchome/landrecords

USDA NRCS Web Soil Survey:http://websoilsurvey.sc.egov.usda.gov/App/HomePage.htm

SSURGO data from the USDA NRCS Web Soil Survey was not compatible with ArcGIS, so the data tables were reformatted in Microsoft Access and imported into the geodatabase created for this map. Once the Trempealeau County geodatabase was put into a folder titled 'Sub' the desired rasters were clipped and reprojected to the shape of Trempealeau County using Python scripting. The script is displayed in a previous blog.

Data Accuracy
Below is a table (Table 1) that information about various attributes of the different datasets used to create the map. Many of the attributes were not included in the metadata of each dataset.
Table 1. Data Accuracy table.
Results
Below is the map (Figure 1) that was created using the various sources of data collected above. The trails feature class was added from the Trempealeau County geodatabase. The maps weren't created for any purpose other than displaying the collected data.
Figure 1. This map was created to demonstrate the use of data gathered from different sources.
Conclusion
The collection of data was difficult considering each source had different ways of downloading the data. This lab helped to get the GIS class used to retrieving information and that this class was extremely helpful in getting our feet wet. Assessing data accuracy was even more difficult, because not every data source openly displayed the necessary information for this lab. It was very frustrating trying to find the information for every field. It is important and necessary to assess the accuracy of data and this lab showed it.

Wednesday, March 15, 2017

Post 2: Python Scripts

Introduction: Python Script 5
This exercise created a script that produced a weighted impact map. This map combines 5 factors that were used to create another map. In this script a streams feature class was weighted 1.5 that of the other factors. The other rasters were then added to the weighted raster to create a final raster.

Introduction: Python Script 4
This exercise created a script to find all historic major attractions within the maritime climate zone using field delimiters, building SQL statements, creating feature layers using those SQL statements and using the MakeFeatureLayer_management function.

import system modules
import arcpy

#set environments
from arcpy import env
env.workspace = "Q:\StudentCoursework\CHupy\GEOG.337.001.2175\KLEINSAS\DemoLab\SanDiego.gdb"
arcpy.env.overwriteOutput = True

fc1= "Climate"
fc2= "MajorAttractions"

#Add field delimiter for the TYPE and ESTAB
field1=arcpy.AddFieldDelimiters(fc1,"TYPE")
field2=arcpy.AddFieldDelimiters(fc2,"ESTAB")

#Build an SQL Statement for the Field TYPE=Maritime
maritimeSQLExp=field1+"="+"'Maritime'"

#Build an SQL Statement for the Field ESTAB<1956
historicSQLExp=field2+">0and"+field2+"<1956"

#Pass SQL Statement to make a New Feature Layer for Maritime
arcpy.MakeFeatureLayer_management(fc1,"MaritimeLyr", maritimeSQLExp)

#Pass SQL Statement to make a New Feature Layer for Historic
arcpy.MakeFeatureLayer_management(fc2, "HistoricLyr", historicSQLExp)

#Select features from the historic layers that are completely within the maritime layer and make a new selection
arcpy.SelectLayerByLocation_management("HistoricLyr", "COMPLETELY_WITHIN","MaritimeLyr","","NEW_SELECTION")

featCount=arcpy.GetCount_management("HistoricLyr")
print"Number of historic features selected:{}".format(featCount)

arcpy.CopyFeatures_management("HistoricLyr", "HistoricMaritime")

Introduction: Python Script 3
The goal of this exercise was to gain experience describing features and using FOR/IN loops.

#import system modules
import arcpy

#set environments
from arcpy import env
env.workspace = "Q:\StudentCoursework\CHupy\GEOG.337.001.2175\KLEINSAS\Python\Demo3.gdb"
arcpy.env.overwriteOutput = True


#set variables for the parameters and buffer the random points by 10 miles.
infc = "Mi_random"
outfc = "Mi_random_buff"
dist = "10 miles"
sidetype = "Full"
endtype = "Round"

#describe the type of dataset and the spatial reference of Mi_random
desc = arcpy.Describe (infc)
sr = desc.spatialReference
print"Dataset Type: " + desc.datasetType
print"Spatial Reference: " + sr.name


arcpy.Buffer_analysis (infc, outfc, dist, sidetype, endtype, "#", "#")

#set variables for the parameters and clip the buffer by the state of Michigan.

clipfc = "MI"
outclipfc = "buff_clip"
arcpy.Clip_analysis(outfc, clipfc, outclipfc)

fc_list = arcpy.ListFeatureClasses()
for name in fc_list:
    desc = arcpy.Describe(name)
    featCount = arcpy.GetCount_management(name)
    print "Name: {} Shape: {} SR: {} Count: {}".format(desc.name, desc.shapeType, desc.spatialReference.name, featCount)


print"the print is complete"

Introduction: Python Script 2
The goal of this exercise was to gain more experience using Pyscripter. In this script the buffer and clip tool were used in Pyscripter.

#import system modules
import arcpy

#set environments
from arcpy import env
env.workspace = "Q:\StudentCoursework\CHupy\GEOG.337.001.2175\KLEINSAS\Python\Demo2.gdb"
arcpy.env.overwriteOutput = True

#set up the buffer tool

arcpy.Buffer_analysis("Mi_random", "Mi_random_buff", "10 MILES", "FULL", "ROUND", "#", "#")


print("The script has completed")


arcpy.Clip_analysis("Mi_random_buff", "MI", "Mi_random_buff_clip")


Introduction: Python Script 1
Python is a script that is used throughout much of the computer science field. This language is also applicable to geographic information systems. This post presents the first python script used in this class to clip, edit and establish a coordinate system for multiple feature classes at once. The software used to create this script was PyScripter for Python 2.7.