Friday, May 10, 2013

Using Python to Assist in Geoprocessing

The focus of this assignment was to gain some experience using Python to run some geoprocessing operations.  One of the benefits of using Python is the ability to create scripts that automate geoprocessing operations.  In this exercise, a iterative feedback loop script was written to automatically create five 1,000 meter buffers around the locations of sand frac mines in Wisconsin.  The script was written by first setting the workspace, followed by specifying the buffer distance.  A while loop was then added and the buffer tool was set to run a total of five times.  The script that was used to run the operation is seen in Figure 1, and the resulting map is displayed in Figure 2.
Figure 1. Python Script
Figure 2. Map of Mine Locations with Buffers
As previously mentioned, Python scripts can be used to automate different operations.  This can effectively cut down on time spent running different tools.  In the previous assignment regarding raster analysis, the Euclidean Distance tool was run on multiple datasets.  A script that automated that process and ran the tool on each dataset would have saved a lot of time.

Sunday, April 28, 2013

Raster Analysis of Sand Frac Mining Locations in Trempealeau County

Goals and Objectives

The goal of this assignment was to conduct raster analysis of a variety of data sets to model sand mining suitability and environmental risk factors in Trempealeau County, WI.  To model suitability, elevation, land cover, proximity to rail terminals, slope, and water table elevation were all considered.  Environmental impact was measured by taking the proximity to streams, prime farmland, residential areas, schools, wildlife areas, and the viewshed from trails and parks into account.  After the initial analysis was performed, the rasters were reclassified using a ranking system (3 = High, 2 = Medium, 1 = Low) to show areas with higher or lower suitability or environmental risk.     
Figure 1. Location of Trempealeau County in Wisconsin.

Data Sets and Sources

The bedrock geology map provided to us was created by the Wisconsin Geological and Natural History Survey.  The USGS National Map Viewer (http://nationalmap.gov/viewers.html) was used to download 2006 Land Cover Data and a National Elevation Dataset for the western portion of Wisconsin. The DEM came in two tiles which were mosaicked together.  A dataset containing the locations of railroad terminals was provided to us by our professor for this project.  Water table elevation data was dowloaded from the Wisconsin Geological Survey website (http://wisconsingeologicalsurvey.org/gis.htm).  A geodatabase containing many files for Trempealeau County was dowloaded from the Trempealeau County land records division website (http://www.tremplocounty.com/landrecords).  

Methods

This project began with the collection of the previously mentioned datasets.  Model Builder was then employed to create the workflow of the raster analysis.  The different rasters were reclassified based on the results.  Those classifications are displayed in Figure 2.  A raster of suitable elevations was created by overlaying a DEM of Trempealeau County on top of a map of bedrock geology in western Wisconsin.  The swipe tool was used to examine the elevations of the most desirable geologic formations for frac sand mining (Jordan and Wowewoc).  These two formations were identified as desirable formations during previous research at the university.  Ten meter contour lines were created from the DEM to aid in identifying the elevation.  The reclass tool was then used to rank elevation based on the 3, 2, 1 scale.  Next, a land cover raster was reclassified.  Barren land (rock/sand/clay) and grassland/herbaceous land were given the highest suitability rank because they would not require the land to be cleared for a mine.  Shrub land, pasture/hay, and cultivated crops were given the medium rank because there would be some time and money needed to clear those land cover types.  Deciduous forest, evergreen forest, and mixed forest land cover areas were given the lowest ranking due to the cost of cutting down and removing trees before a mine could be created.  Open water, developed land, woody wetlands, and emergent herbaceous wetlands were given a value of zero and later removed from the raster.  The Euclidean distance tool was used to calculate the distance from the locations of railroad terminals in Wisconsin.  This tool calculates the straight line distance from an object, which in this case is the railroad terminals.  The distances in Trempealeau County were then ranked and reclassified.  The DEM was then used to calculate slope in terms of percent rise.  Block statistics were run on the slope raster to average the slope values and the resulting raster was reclassified.  A vast amount of water is used in the sand frac mining process to wash away fine particles.  Areas where the water table elevation is higher are more desirable for mining locations because of the lesser cost for well drilling.  Therefore, a water table elevation coverage file for Trempealeau County was downloaded and imported into a geodatabase.  The water table elevation contours were converted into a raster using the topo to raster tool.  This tool interpolates elevation values for a raster and is specifically designed for the creation of hydrological DEMs.  The resulting criteria rasters were then added together using raster calculator.  Finally, wetland and developed land areas were excluded by reclassifying the landcover raster into a binary raster and multiplying that with the raster containing the previously added values.  This output was then reclassified again to create the final index model (Figure 11).  The model showing the workflow for this suitability assessment is found in Figure 3.          
Figure 2. Index table for suitable locations.

Figure 3. Model for generation of suitable locations for sand frac mining in Trempealeau County, WI.  
The second portion of the lab exercise involved identifying criteria that would have an impact on communities and the environment.  Again, a three-part scale was used to rank the impact (3 = High, 2 = Medium, 1 = Low) of a sand mine.  High impact locations are areas where a sand mine should not be located.  Figure 4 contains the classifications for each raster.  Using a dataset from the Trempealeau County geodatabase, the euclidean distance from streams was calculated and the resulting raster was reclassified.  I chose to use "primary over land perennial" and "secondary over land perennial" streams in this calculation because they are the main streams in the county.  If other smaller intermittent streams were included in the analysis, the entire county would have been in close proximity to streams.  Euclidean distance was then calculated from prime farmland in the county and the resulting raster was reclassified.  In order to incorporate the distance from residential areas, zoning data was used from the Trempealeau County geodatabase.  All residential zones were selected and euclidean distance from those zones was calculated.  Since the minimum distance from residential areas a mine can be located is 640 meters, that value was chosen as the classification break for the high impact class.  Using zoning data could have limitations because there may not be people living everywhere in the residential zones.  Because schools may not have been included in the previous analysis, a separate analysis was completed to incorporate the locations of schools.  A query was built to select all parcels owned by schools in the county and euclidean distance was used to determine the distance from schools.  The euclidean distance raster was reclassified with 1,000 meters as the break for the high classification.  Sand mines can be an eyesore on the landscape, and to incorporate this into the analysis, the viewshed tool was employed to calculate the areas that can be seen from prime recreation areas.  The viewshed tool calculates the number of times a point can be seen from an input feature class.  In this case, a trails feature class and parks feature class were used.  I chose to use wildlife areas as the final factor to include in the impact assessment.  The distance from wildlife areas was calculated and reclassified.  The final community and environmental risk raster was created by adding all of the rasters together using raster calculator (Figure 18).  Figure 5 depicts the model used in this impact assessment.          

Figure 4. Index table for risk factors.

Figure 5. Model for generation of risk areas for sand frac mining in Trempealeau County, WI.

Results and Discussion

The following maps display the reclassification of each factor that was included in the suitability and impact assessment for locations of sand mines, as well as the final index models.
Suitability
Figure 6. Suitable elevations for sand frac mining in Trempealeau County, WI.
Figure 7. Suitable landcover for sand frac mining in Trempealeau County, WI.
Figure 8. Suitable proximity to railroad terminals for sand mining in Trempealeau County, WI.
Figure 9. Suitable slope for sand frac mining in Trempealeau County, WI.
Figure 10. Suitable water table depth for sand frac mining in Trempealeau County, WI. 
Figure 11. Index model for suitable locations for sand mining in Trempealeau County, WI.
Figure 11 shows the final index model for suitable locations for sand mines in Trempealeau County.  The highest value on the model is 14 out of a possible 15, and it is apparent that there are very few green areas in the county that indicate higher suitability.  The green areas are found in the northern and southern portions of the county and are bordered by distinct lines representing the classification of distance from railroad terminals.  To find larger areas that are best suited for sand mines, the rasters would have to be reclassified to include a larger range of numbers in the high suitability class. 
Environmental Risk
Figure 12. Environmental risk of proximity to streams for sand frac mining in Trempealeau County, WI.
Figure 13. Environmental rist of proximity to prime farmland for sand frac mining in Trempealeau County, WI.
Figure 14. Risk of proximity to residential areas for sand frac mining in Trempealeau County, WI.
Figure 14. Risk of proximity to schools for for sand frac mining in Trempealeau County, WI.
Figure 15. Viewshed from trails in Trempealeau County, WI.
Figure 16. Viewshed from parks in Trempealeau County, WI.
Figure 17. Environmental risk of proxomity to wildlife areas for sand frac mining in Trempealeau County, WI.
Figure 18. Index model for risk factors in locations of sand frac mines in Trempealeau County, WI.
Figure 18 shows the index model for risk factors of sand mines in Trempealeau County.  In all, seven factors were taken into consideration, which means that 21 is the highest possible value.  This model has values that range from seven to 21.  A large area with a high environmental and community impact can be seen in the northeast corner of the county near the city of Osseo.  When examining the different factors that were included in this final model, it is evident that this area has a high impact value because there are streams nearby, it is in close proximity to prime farmland, residential areas, schools, and wildlife areas, and it is in the viewshed from parks and trails.

Conclusions

This lab was a great way to incorporate raster analysis and Model Builder to examine a current issue in western Wisconsin.  I was able to create a suitability model for sand mine locations, as well as a community and environmental risk model to show which areas a sand mine would have the greatest negative impact on.  The suitability model showed very little area that was highly suitable for sand mines.  This could have been due to the classifications that were chosen for each factor.  One of the benefits of Model Builder is the ease in which the inputs or settings can be changed, making it easy to reexamine and possibly change some of the classifications to find more areas that are highly suitable for sand mines.  Besides near the city of Osseo, the risk model showed very few areas where a sand mine would the greatest impact on the environment and community.  It is also important to remember that this is a theoretical model and may not reflect actual suitability or impact.

Friday, April 5, 2013

Network Analysis of Sand Mining in Wisconsin

Goals and Objectives
The purpose of this assignment was to continue work from previous exercises and perform network analysis.  The goal of the assignment was to calculate the routes a truck would take from each sand mine to the closest railroad terminal.  This information was then to be used to calculate a hypothetical equation to infer the costs of road maintenance for each county due to the increased traffic of large, heavy trucks.  

Data Sets and Sources
The mine locations dataset came from data downloaded from the following two websites:
http://www.wisconsinwatch.org/2012/07/22/map-frac-sand-july-2012/
http://www.tremplocounty.com/landrecords/
Many addresses from Wisconwinwatch.org were incomplete and needed to be manually geocoded.  A streets network dataset and counties shapefile was obtained from ESRI.  Additionally, a railroad terminal dataset was provided.    




Methods
There are four main steps to completing this assignment:
1.) Determine the closest rail terminal to each mine
2.) Determine the most efficient route from each mine to rail terminal in terms of time
3.) Calculate the total length of routes in each county
4.) Create an equation to estimate the maintenance cost each county will incur due to increased traffic of heavy sand truck traffic

To begin the project, the mine locations, railroad terminals, and streets network data was loaded into ArcMap and a new closest facility layer was created.  We were then instructed to load the facilities (mines) and incidents (rail terminals) and examine the results.  This did not generate the correct results, as the route from each rail terminal to the nearest mine was calculated.  The mines and rail terminals were then switched to calculate the correct results.  Model builder was then used to create a workflow (Figure 1.) that will calculate the route distance for each county.
The blue ovals represent input datasets, the yellow rectangles are tools, and the green ovals are output datasets.  The first step was to add another closest facility layer based on the streets network dataset.  The add locations tool was then used to load the locations of the mines and rail terminals.  The solve tool was then added and run to calculate the routes from each mine to the nearest rail terminal.  In order to export this route into a feature class in a geodatabase, the select data and copy features tools were added.  The intersect tool would be utilized to calculate the length of the truck routes for each county.  This tool computes a intersection of where the routes and counties files overlap.  Before this analysis could take place, the project tool was added to the model to put the routes and counties files in the same coordinate system.  The summary statistics tool was the final tool used in the model.  This tool computes specified statistics based on a field.  In this case, the sum statistic was used on the shape length field and was based on the county name to calculate the total length of routes for each county.  An equation was then created to calculate the total road maintenance cost for each county based on the length of the routes.  The equation would consist of the length of the route in each county, a number to convert the units from meters to miles, the number of trips each truck would take to and from the railroad terminal, and a hypothetical maintenance cost of 2.2 cents per truck mile.  This equation, done with the field calculator, was: cost=(shape_length field) (.000621371) (100) (.022).  The table was then copied into Excel for formatting.    

Results and Discussion



Map 1 displays the most efficient routes from sand mines to rail terminals in Wisconsin.  A bar graph displaying the data for each county was added to the map to aid in visual analysis.  As you can see, most of the mines are located in western Wisconsin, while most of the rail terminals are located in the southeastern portion of the state.  Because Eau Claire and La Crosse counties have the only two rail terminals in western Wisconsin, they have the highest route lengths and incurred estimated costs.  Other counties with high route lengths and costs are Chippewa, Monroe, and Trempeleau.  This network analysis could be important to these counties because they might want to consider placing a higher tax on sand mines to offset the incurred costs of increased traffic.    


Table 1 contains the total length of routes and estimated maintenance cost for each county.

Conclusion
Overall, I thought this was a very interesting and educational project that applied GIS analysis to a current issue in western Wisconsin.  I was able to calculate the most efficient routes from each sand mine to rail terminal, the total length of routes for each county, and create a equation to come up with a hypothetical cost incurred from the heavy stand trucks.  Model builder was a bit difficult to work with at the beginning, but ended up being a very efficient method of performing the calculations.  This streamlined the process because each tool did not have to be independently run.  Finally, I enjoyed obtaining a better understanding for network analysis and the functions and uses for it.  I was able to apply some of the skills to my research project on the locations of Minor League Baseball stadiums by creating a new service area to find the extent of the area where people can drive to the stadiums within 30 minutes.      




Friday, March 15, 2013

Data

The goal for this project is to apply GIS analysis to the real world issue of sand mining in western Wisconsin.  In addition, a major component of the project was to gain experience in downloading data from a variety of sources, and the creation and management of a geodatabase.  The project was broken down into different sections, with the first being the process of acquiring the data.  The first website visited was the National Atlas website (http://www.nationalatlas.gov/).  This site provided a national railroad dataset that will be used for transportation analysis.  The USGS National Map Viewer (http://nationalmap.gov/viewers.html) was used to download 2006 Land Cover Data and a National Elevation Dataset for the western portion of Wisconsin.  The DEM came in two tiles and were mosaicked together.  Next the USDA Geospatial Gateway website (http://datagateway.nrcs.usda.gov/) was visited to obtain cropland data for the state of Wisconsin.  Finally, the NRCS SSURGO website (http://soildatamart.nrcs.usda.gov/) was used to obtain soil data for Trempeleau County.  The soils data came in the form of a Microsoft Access database and needed to be imported to the geodatabase that was created for this project.  To do so, a micro was used to import the tabular data into the geodatabase.  A relationship class was then created to join the tabular soil data to the soil feature class.  Finally, a drainage index table was downloaded and joined to the feature class for symbolization.  After all of the data was downloaded, each dataset was projected in the NAD83 UTM Zone 15N projection.  Figure 1 shows the downloaded and projected data and Figure 2 shows the geodatabase that was created.
Figure 1. Data obtained from various websites.
Figure 2. Geodatabase
The second part of the project entailed geocoding the locations of mines within western Wisconsin.  Geocoding is the process of locating points from an address.  Trempeleau County has a lands division website where a geodatabase was downloaded to gain access to mine locations within the county.  Since our study area is larger than the county, a spreadsheet containing the information for mines in the rest of the state was obtained from (http://www.wisconsinwatch.org/2012/07/22/map-frac-sand-july-2012/).  Upon examination of the spreadsheet, it was apparent that the data needed to be normalized.  Addresses were either incomplete, given in township and range sections, listed in a general description of the area, or not given at all.  To gain a better understanding of how the geocoder in ArcMap works, we were told to run the geocoder with the addresses as is.  It was able to locate zero of the addresses due to the lack of a "state" field in the spreadsheet.  After some editing of the addresses and the creation of the "state" field, the geocoder was able to locate about 54% of the 120 mines.  The rest of the mines would have to be manually matched due to discrepancies or lack of an address.  For the sake of time, the addresses were divided up between four group members.  Figure 3 shows the 17 mines that I was assigned.
Figure 3. Mine Addresses.
To locate the mines that had addresses in PLSS format, a server was connected to that contained a statewide shapefile containing the township and range sections.  To match the addresses, aerial imagery was displayed in ArcMap and used to locate the mines.  Once the location was found, the pick address function was used to plot the point.  A very helpful resource for this process was a Google fusion table that contained the locations of mines all across the state (https://www.google.com/fusiontables/DataSource?docid=17nDFI4iUPOdyDOEWU7Vu1ONMiVofa3aWR_Gs-Zk#rows:id=1).  Although not all of the mines were located in the exact correct location, it was a great reference to use through the process of manually matching the addresses.  Of the 17 mines that I was assigned, only three addresses were able to be matched after a "zip code" and "state" field were created, leaving me with 14 to match.  The locations for the mines that I was assigned are shown in Figure 4.
Figure 4. Geocoded location of assigned mines.
          

Overview of Sand Mining in Wisconsin

Over the past five years, western Wisconsin has seen a rapid increase in the number of sand mines.  This is due to advances in the extraction of oil and gas via a method called hydraulic fracturing, or fracking.  This method injects sand, water, and other chemicals into wells to create spaces in the rock and allows the oil and gas to be extracted.  The silica sand in western Wisconsin is perfect for this application due to its size, shape, and hardness.
Figure 1. Ideal silica sand for fracking.
Image source: http://minnesota.publicradio.org/display/web/2011/04/21/red-wing-fracking-sand

As previously mentioned, most of the sand mining is taking place in western Wisconsin.  Figure 2 depicts the locations of sand mines as of June, 2012.
Figure 2. Sand Mine Locations
Image Source: http://www.leadertelegram.com/news/front_page/article_13ecfa4a-d3b3-11e1-a2de-001a4bcf887a.html
After the sand is mined and processed, it is transported by rail to locations to be used for fracking.  Most of the sand mined in Wisconsin travels to North Dakota, Texas, the Eastern US, and Canada (http://www.leadertelegram.com/news/front_page/article_13ecfa4a-d3b3-11e1-a2de-001a4bcf887a.html).  Because railroads are the primary mode of transportation for the sand, mines are often located near railways.

There are many issues related to the mining of sand that are causes for concern.  The mining process requires large amounts of water that is drawn from the water table.  Many people are worried about water shortages, as well as contamination of their own drinking water.  Another health hazard stemming from the mining of silica is related to lung issues.  The inhalation of fine silica dust can lead to many respiratory problems including lung disease, lung cancer, and asthma (http://www.huffingtonpost.com/2012/12/07/frac-sand-mining-wisconsin-health_n_2256753.html).  Sand particles are not In addition, the mining takes a toll on the environment through the physical destruction of the landscape.  Figure 3 shows a typical sand mine located in Wisconsin.  Here the expanse and destruction of the landscape is visible, as well as the large pools of water needed in the mining process.  It should be noted that after the completion of mining in an area, the mining company is required to repair the landscape.
Figure 3. Aerial view of sand mine.
Image Source: http://grist.org/natural-gas/against-the-grain-fracking-companies-mine-rural-wisconsin-for-sand/