Monday, September 28, 2015

Intro to ERDAS Imagine and Digital Data


This is a subset of an image we processed using ERDAS Imagine.  First we had to learn a bit about how to use this new program, which seems to have a huge range of capabilities.  After loading a raster image into the Viewer and making sure the display was set to Pseudo Color, we spent some time learning how to navigate around the image and comparing one image at a lower level of detail (AVHRR) with one a LANDSAT Thematic Mapper satellite image.  The first was classified, while the second was continuous - raw data from the sensor.  We set the preferences to enable Fit to Frame and Background Transparent, making sure the Clear Display option was off, and experimented with options in the Multispectral tab to see what combination of Bands enhanced which types of features, such as vegetation, rivers, urban areas, etc.  The third part of this lab was the creation of a map which we began in ERDAS Imagine, where we created an attribute to show the area of each class in the image, and then exported a subset of the map to make a map in ArcMap.  This was done using the Inquire Box and then creating a subset image.  In ArcMap we made Class_Name the value field, with Unique Values chosen so that the hectares for each class would be listed.  I chose to edit the description so that the information would remain with the data rather than being temporary. 

Clearly the ERDAS Imagine program is very useful and has huge capabilities, but is limited by a few bugs which is unfortunate.

Tuesday, September 22, 2015

Truthing for Accuracy

The red and green dots represent 30 sample points that were randomly selected in order to check the accuracy of how they were classified in last week's lab.  I located them in a way to reduce bias, by creating and locating them in roughly equal proportions according to each classification type. Then, using Street View in Google Maps, I examined each site and recorded whether it was accurate or not, and if it was not, what classification it should have been.  Finally, I calculated the % accuracy of the sample points.  Because we generalized in making the polygons and classifying them originally, the accuracy was not very high.  Sometimes the point landed on a structure that was commercial rather than residential, although overall the polygon seemed to be the correct type.  In one case, what had been a sandy area when the photograph was taken had been built up with several houses.  What I had thought might have been an academic complex turned out to be several businesses and the Jackson State Fairgrounds.  Several areas that seemed forested were actually residential.  A closer reading of the classification descriptions also prompted me to change one or two classifications.

Tuesday, September 15, 2015

Level II LULC Classification

 
 
Classification of land use and land cover was the focus of this week's lab.  An aerial photograph of an area of Pascagoula, MS was digitized to create a land use/land cover map.  Features were identified using tone, pattern, shadows, size and shape, and associations, the subject of last week's lab, and then polygons were drawn around those features and classified.  The USGS Standard Land Use/Land Cover Classification System we used has several levels - we worked at Level II.  To begin, Level I classifications were identified, such as Urban or Built-up Land, Forest Land, and Water.  Within each of those, Level II categories were located, such as Residential areas, Lakes, and Deciduous Forest Land.  To create the map, the polygons were labeled, a logical color scheme was chosen to highlight the various categories, and the other essential map elements were added.
 
From this map, it is clear that Level II classification is quite general, and that by generalizing, many specific features and land types are incorrectly identified.  Level III classification provides far better identification, but is obviously more time consuming.

Monday, September 7, 2015

Visual Interpretation of Aerial Photographs

This week we produced 2 maps showing some of the ways that aerial images can be interpreted.  The first map shows variations in tone and texture.  There are 5 variations for each scale, with each polygon enclosing one variation.

 
 
The second map uses 4 criteria to identify features: Shape and Size, Shadows, Patterns, and Association. 

Monday, August 3, 2015

Sharing Tools


The final week's lab required that we open and edit a script, updating it so that the hard-coded variables for input boundary feature and output file location parameters were set using the sys.argv[ ] code instead.  This code uses a number system beginning with 1 for the first parameter, rather than 0 which is where parameters set with GetParameter and GetParameterAsText functions use.

The next step was to edit the tool's description in ArcCatalog to make the tool more user-friendly and informative.  We added Dialog Explanations for each parameter, which shows up in the dialog box when using the tool as seen in the screenshot here on the left.  On the right is the map created by the tool which created random points and then put a buffer around each one.

The last step was to embed the script into the tool so it could be shared without adding a separate script file, and so that it could be protected with a password, which we did. 

Two other steps which are important are making sure that relative file paths are stored (check box), and that the .py extension is made visible in ArcCatalog, via the Options box.

Sunday, July 26, 2015

Module 10: Custom tools

 
The ability to turn a script into a custom tool was this week's topic.  To do that, the following basic steps were followed:

1.      Create and save a .py script
2.      Create a custom toolbox for storing it
3.      Add a script tool to the custom toolbox with the AddScript wizard, selecting the saved .py script
4.      Modify the code in the script so it can receive the parameters set by the tool dialog box
5.      Set up the parameters in the tool’s properties
6.      Edit script using GetParameterAsText and GetParameter functions to set up parameter Dialog box for script tool

 
Here is a screenshot of the parameter Dialog box that allows input to the script tool.  Here there are 4 parameters, two of them already showing default locations for input and output files.  These are examples of workspace type parameters.  Two feature class parameter types are also listed: clip boundary feature and input features.  The latter was set to have a MultiValue property, since more than one .shp was used in this situation. 
 
 
 
Before the script tool ran, we edited it once more, adding AddMessages statements so that they would print in the results window, as shown below.

 
This lab was especially useful in showing how all the work of creating scripts can be used in a more simple, direct, and integrated way in ArcMap.

Wednesday, July 22, 2015

Module 9: Rasters

Last week we worked with Vectors, this week we learned how to write scripts for Raster data.  The functions and classes found in the arcpy.sa module are used to list, describe, create, and modify rasters.

ListRaster is used to find out what rasters exist in a workspace - Esri GRID and geodatabase rasters do not have file extensions; .img, .tif, and .jpg are returned for other image formats.

Describe returns general and specific properties of raster datasets.  The elements that can be described are datasets, bands, and catalogs.  Different properties are available depending on which element is being described.

Once a raster object is created, it can be used in other Python statements and map algebra statements.  Properties include band count, cell height and width, spatial reference, pixel type, and more.  The raster object has only one method possible - save.  This is used to make a temporary raster object permanent after ArcMap has closed.

In order to be able to use the tools in the arcpy.sa module directly, all the functions can be imported.  This can be helpful especially when using map algebra operators.

Several classes in the arcpy.sa module were introduced, including Remap and Neighborhood.  There are 8 others.

This week's lab asked us to create a raster from 2 existing rasters: elevation and landcover.  To start, we wrote code to see if the spatial analyst extension was available, then checked out the spatial analyst extension.  Next we reclassified the landcover raster so that 3 forest landcover classifications were changed to 1.  Then we created temporary rasters for elevation that had slope between 5-20 degrees, and aspect between 150-270 degrees.  The combined temporary rasters were saved to a final raster in a newly created geodatabase, and the spatial analyst extension was checked back in.  Below is the result, seen in ArcMap.