Tuesday, November 19, 2024

Using ArcGIS Pro for Time Series Analysis of Landsat Data

Project
Run a time series analysis to analyze spectral recovery following the 2000 Jasper Fire in South Dakota.

Data
For this project data was obtained from June 1- August 31 each year from 1995 to 2022. Landsat 5, 7 and 8 sensors were all included and data was selected from Earth Explorer. Data was converted to the NBR spectral index, projected to UTM Zone 13, and clipped 3 meters of the burn boundary using ESPA. 
After downloading, peak of greenness (POG) was estimated using the MTBS NDVI online tool. Python was used to narrow files to those which fell within 5 days in either direction of POG. After the datasets were selected, ArcGIS Pro was used to decode the QA pixel for each dataset and select the clearest images that fell within range of the POG. Each dataset was rated subjectively on a scale of 1-3 with 1 being unsuitable for analysis, 2 being suitable but still very cloudy and 3 being mostly clear. If multiple datasets were suitable for analysis and fell within the 5 day range, the one closest to the actual data was selected. If POG lasted for a longer period of time and multiple clear datasets fell within POG the central dataset was selected. For 2013 a dataset within 5 days of POG was not possible due to limited data sets that covered the burn boundary and fell within the peak of greenness dates, so the dataset that was closest to POG and acceptable for analysis was selected.

Creating and Populating a Mosaic Dataset
Once a suitable POG dataset was selected for each year of analysis, datasets were compiled into a mosaic dataset in ArcGIS Pro using the Create Mosaic Dataset tool followed by the Add Rasters to Mosaic Dataset tool. 

Examples of the Create Mosaic Dataset and Add Rasters to Mosaic Dataset tools


The following steps outline how to populate and mask a mosaic dataset.
After creating a Mosaic Dataset add the desired raster types. The tool has to be run separately for each of the Landsat types. Set the raster type to the appropriate Landsat sensor. The default raster type is "Raster", but if you leave this setting you will pull the .tif files instead of the .xml/ MTL files. If you want to add a cloud mask to your files later on it is necessary to pull the data from the .xml/MTL file. If you pull the .tif files the group name isn't populated so you will be unable to match the appropriate QA band to the appropriate raster.

 For the purposes of my analysis I wanted to add the Spectral Indices as my processing template, which would pull my NBR file. I changed input data to "Folder" and selected the folder with my chosen dataset. I then selected to calculate mosaic statistics and clicked run to add the files to my dataset. Repeat this for all Landsat sensors represented in your datasets.

After all the spectral index files are added to the mosaic dataset, add the QA files. This process is similar to adding the indices but instead of selecting "spectral indices" as the processing template select "QA". After selecting the processing template, click the edit button beside the template. This pulls up the raster functions pane.

 In the raster function page, search for the "remap" function. Drag the remap function to the function editor pane. Remove the identity function and click and drag your mouse from the QA raster to the remap function. An arrow should appear, linking your raster to the function. 

Double click the remap function in the function editor to bring up the remap properties pane. Set the variables to match with the desired pixel values according to the landsat documentation for the specific sensor you selected, Landsat 8 has different pixel values than Landsat 5 and 7. Set the output value to 1. For my map I wanted all clear pixels to remain visible and all others set to "No Data". Make sure the  "Change Unmatched Values to NoData" option is selected.

The raster functions pan can be seen on the left, the function editor appears on the bottom of the screen and the remap properties pane appears above it. The pixel values in this example align with the "clear" pixel values obtained from Landsat 8 documentation on the USGS website. Landsat 5 and 7 use different values to represent clear pixels.




Hit the save button at the top of the function editor. This should bring you back to the "Add Raster to Mosaic Dataset Pane". Deselect the "Estimate Mosaic Dataset Statistics" and click run to add the QA raster. Repeat for all sensors.

This is important for masking: in your attribute table for your mosaic, make sure the GroupName column for your rasters is present. Your raster group name should match up to the corresponding QA pixel group name. The Tag column should match the processing template chosen when uploading your rasters.

Attribute table for the mosaic dataset. Can be accessed by right clicking the mosaic dataset and selecting "Open Table"


To create a mask template access the catalog pane and right click your mosaic dataset. Select "Manage Processing Templates". Click the hamburger menu button and select “Create New Template”. Under raster functions search for clip and add clip raster function to the raster function editor. Double clip the clip function to open the clip properties pan. Click the variables tab and set the appropriate GroupName variables as the "Raster" and "Clip" features, these variables will align with your "Tag" column in the raster attribute table. In my case the Raster to be clipped was the SpectralIndices and the clipping raster was the QA raster. Click Okay. 

Save the raster in the function editor. This will pull up the "Save" pane. Add desired name and description information. Set the "type" field to item group. Set the group field as "GroupName" and the tag field as "Tag". Uncheck the match variables option.




Example of the Clip Properties and Save panes


After saving the Clip Function, return to the Manage Processing Template pane and click to star to set it as your default template. Your mosaic dataset should be masked, but if for some reason the processing template is not applying you can make sure it is activated through the ribbon. With your mosaic dataset selected in your contents pane, select the "Data" tab at the top of  the ribbon. Under the "Processing" group select "Processing Templates" and make sure your masking template is selected.

Create a Multidimensional Dataset
To add multidimensional data to a mosaic dataset utilize the Build Multidimensional Information Tool. Set the variable field to the product name and set the variable name to the appropriate layer, in my case I set it to Spectral Index. Set the Dimension field to the Acquisition date.

After running this tool you should be able to adjust the slider along the top of the map view to view your masked data over time.


Finally, use the Copy Raster Tool to convert the multidimension dataset to a CRF file. Select the options to "Process as Multidimensional" and "Build Multidimensional Transpose". You now have a .CFR file suitable for time series analysis. 


The Copy Raster Tool converts the multidimensional dataset to the .CRF format to optimize for analysis.






Thursday, October 3, 2024

Module 6- Special Topics- Scale Effect and Spatial Data Aggregation

Our final lab for Special Topics began with exploring the effects of scale on vector data and resolution on raster imagery. We began with a hydrographic vector data set scaled to 1:1,200, 1:24,000, and 1:100,000 and calculated the area and perimeter of the polygon features as well as the count and total length of the line features. The result of scaling the feature classes differently was that as the scale decreased, variables calculated for the water features increased. In addition to the length of the water features being calculated at a higher number, the difference in the scale was visually noticeable as some hydrographic features were only visible at smaller scale.

A close up view of my hydrographic line features with yellow being the largest scale, and blue being the smallest scale. As you can see, the smaller the scale the finer the features that visible.


After exploring scale we resampled a DEM file to compare 6 different resolutions: 1m, 2m, 5m, 10m, 20m, 90m. Raster resolution is correlated with pixel size, so smaller resolution numbers indicate smaller, more detailed pixels, while a raster with larger pixel sizes would be expected to have less detail. We calculated the slope of each raster and examined the results which showed that as the resolution increased, the average slope also decreased.

For the second half of the lab, we explored the Modified Area Unit Problem by using census data to explore how the results of our data analysis can differ based on how we group our data for analysis. In this situation we were analyzing census data to determine how race affected poverty status, and we separately analyzed data by block groups, zip codes, housing voting districts and counties. We saw that the data could vary significantly based on which of the 4 units of analysis were used to analyze it.

Lastly, we explored gerrymandering. Gerrymandering is the process of manipulating the boundaries of voting districts in order to favor a certain political party. Gerrymandered districts tend to have very irregular boundaries and one way to measure this is the Polsby-Popper Test, which uses and equation to measure how compact a district is on a scale of 0 (least compact) to 1 (most compact), with the assumption that the most compact districts are the least gerrymandered. Here is an examples of an extremely gerrymandered district as determined by this method.



Tuesday, September 24, 2024

Lab 5- Interpolation- Special Topics

Interpolation is a way of making predictions based on known values. We interpolated the surface water quality of Tampa Bay using the BOD Mg/L variable from multiple sampling locations.

Interpolation methods explored were
        - Spline (regular)
        - Spline (tension
        - IDW
        - Thiessen polygons

IDW uses the distance of each data point to neighboring values to weight its predictions, whereas the Spline interpolation techniques fits through a set of input points to make its estimation. Spline is not constrained by the limits of the provided data and can give values greater or less than the highest and lowest data points, while IDW is constrained to the highest and lowest data point. 

Thiessen interpolation creates a series of polygons with each data point associated with the central location of a polygon. Because of this the size of the polygons is variable and dependent on the distance from other sampling locations. Each polygon is given the value of the central point and there is not estimation or continuity to the data. This method was not ideal for measuring water quality.

In this exercise my regular spline interpolation ended up displaying values that were not mathematically possible, giving me large swaths of negative value areas. It is highly unlikely for water quality to be at 0, and impossible for it to be a negative number. The tension method was a more accurate and aside from a greater range of values, data was closer to that displayed by the IDW. I personally chose to map the data along standard water quality monitoring guidelines using the following table for analysis:

and when using these guidelines the spline (tension) method only slightly differed from the IDW with the majority of the data falling into the "very good" range for both data sets, but a slightly bigger circle area falling under "fair" in the spline tension map.

IDW: "Fair" data is mapped in yellow and "very good" data in green

Spline tension: "Fair" data is mapped in yellow and "very good" data in green

Finally, here is more thoroughly symbolized view of my IDW map with BOD estimates. Although I would not necessarily need to use these number for water quality estimation, they give a good visual of how the IDW interpolation method calculated the water quality with regard to the data points.


 



Sunday, September 15, 2024

Special Topics- Lab 4- TINS and DEMS

 This week we explored utilizing ArcGIS Pro to create elevation models. Additionally we converted a DEM to a TIN in order to create a ski run suitability map that weighted aspect, slope and elevation and presented ideal locations for a ski slope.

TINs and DEMs are terrain models used to analyze topographic features. TIN data uses a type of vector data to model a 3D surface by linking a series of triangles of different sizes based on elevation point data. These data points vary in density in proportion to the terrain the terrain. More complex terrain contains more data points, while simpler terrain contains fewer data points. A DEM consists of raster data consisting of a regular grid pattern that models elevation. 

We used our TIN and DEM models to depict the contour lines and slope of our data. Although DEM contour lines are smoother and more reminiscent of a typical map, TIN contour lines are more accurate due to the ability of the data to represent various surface features, notably peaks and ridges.

The first image displays my TIN while the second image contrasts my DEM layer of the same data.





The biggest difference I noticed between the two layers was that the DEM seemed to over estimate the uppermost regions of the data, adding contour lines where they were absent from the TIN data.



Wednesday, September 4, 2024

Special Topics- Data Quality Assessment- Module 3

 This week we were asked to assess the quality of two road network data sets, Street Centerlines and Tiger, by comparing the completeness of the data on a grid-by-grid basis. We then mapped the resulting data onto a choropleth map.

To run this assessment, I split the data so that each grid could be analyzed separately.  I then used spatial join and summary statistics tools to further process the data. I exported my statistics to Excel to more easily analyze it and found that the Street Centerlines had no data for one of my grids. In total the Street Centerline data was 10,671.1 km in length with 134 of the grids being more complete than the Tiger data. The Tiger data was 11,253.4 km in length with 163 grids being more complete than the Street Centerline data. The Street Centerline data had 5.4% less road coverage than the Tiger data.

After assessing the data in Excel, I returned to ArcGIS and created a field to calculate the percentage difference between the datasets. There was an median of -0.18% difference in coverage between the Street Centerline and Tiger data.

I used this percentage difference field to create my choropleth map:





Tuesday, August 27, 2024

Special Topics- Data Quality- Standards- Module 2

 This week we used the standards set by the National Standard for Spatial Data Accuracy (NSSDA) to determine positional accuracy of a provided road network. The positional accuracy of the test data was compared to an established data set as well as to reference points obtained to orthographic images of the study area.


To determine accuracy we chose a sampling of 20 points meeting specific criteria (no less than 4 per quadrant, greater than 10% of the diameter in distance from other points) along intersections. We established reference and testing feature classes for each intersection. 





After creating our feature classes we added XY coordinates to the data. We used excel to calculate the RMSE and NSSDA values.

Based on my results I determined the following about the positional accuracy of each data set:

The ABQ street data tested  4.18 feet horizontal accuracy at 95% confidence level.

The Street Maps USA data tested 434.85 feet horizontal accuracy at 95% confidence level.


Wednesday, August 21, 2024

Special Topics- Calculating Metrics for Spatial Data Quality- Module 1

 This module covered spatial precision, accuracy and bias. We also learned how to calculate root-mean-square error and cumulative distribution function.

Accuracy refers to the closeness of a collected data to an accepted reference point, while precision refers to the agreement between the data points. 

To determine accuracy we created a feature class with a single feature that represented the average of the latitude and longitude of all the collected data. We then compared this with a provided reference point that represented the "true" value.

To determine precision we spatially joined the average point feature class with the original point data feature class to obtain a distance attribute calculation. We calculated the distance of 50, 68 and 95 percentiles of the data from the average location, and used the buffer tool to create a visual representation of the percentiles. After determining the horizontal precision and accuracy we then determined the vertical precision and accuracy using the altitude data.

Our horizontal accuracy was 2.97 meters while our horizontal precision was 4.17 meters. 

GIS Portfolio

 We were tasked to create a GIS portfolio for our internship program. It was a great opportunity to put organize the work I have been doing....