Posts

Module 2: LiDAR

Image
   This lab used LiDAR data to create a Digital Elevation Model (DEM), Digital Surface Model (DSM), forest height raster, and canopy density map. LiDAR point clouds were converted into raster datasets, and spatial analysis tools were used to calculate vegetation height and canopy density. The resulting maps and histogram illustrate the distribution of forest structure and demonstrate how LiDAR can be used to assess terrain and support forest management and conservation efforts. 

Module 1: Crime Analysis

Image
    In this lab, Washington D.C. burglary data were analyzed by selecting burglary incidents, performing a spatial join to count burglaries within census tracts, joining housing data, and calculating burglary rates per 1,000 housing units. The results were displayed as a graduated color choropleth map after excluding outlier tracts.        A kernel density analysis was then completed for assault incidents using a 100-foot cell size and a 1320 foot search radius. The raster was classified into six classes based on multiples of the mean density to identify hotspot areas.       For the Chicago homicide analysis, three hotspot mapping techniques were compared. The grid overlay method counted homicides within grid cells and selected the top 20% of cells. Kernel density was performed using a 100-foot cell size and 2630 foot search radius, with hotspots defined as areas greater than 3 times the mean density. Local ...

Module 6: Geometries

Image
 In this module, I worked with geometry objects and nested loops in Arcpy to extract vertex information from a shapefile. The objective was to access the geometry of river features, iterate through every vertex, and write the coordinate information to a txt file.  I began the script by creating a Search Cursor for the rivers shapefile and accessing the OID, geometry and river name fields. Because the geometry object contains arrays of vertices, I used loops and the getPart() method to access each point that makes up a river feature. As the script iterated through the vertices, it assigned a vertex ID, printed the information and wrote the feature OID, vertex ID, X coordinate, Y coordinate, and river name to the created txt file. The results of the script:  This assignment helped me better understand how geometry objects are structured in GIS datasets. I learned how loops are used to move from features, to arrays, to individual vertices and how the getPart() method simplif...

Module 5: Explore and Manipulate Data

Image
 For this module, I worked with the ArcGIS notebook to explore and manipulate data. I focused on working with geodatabases, feature classes, lists, dictionaries and cursors.  The first goal was to create a new file geodatabase in the Results folder using my student username. After setting the workspace and enabling overwrite output, I generated a new geodatabase.  Next, I generated a list of all shapefiles in the Module 5 Data folder and used a for loop to copy each feature class into the newly created GDB. The describe function and its basename property were important because geodatabases do not use the .shp extension found in shapefiles. This process reinforced the use of loops and ArcPy geoprocessing tools.  After the data was copied, I changed the workspace to the new geodatabase and created a search cursor for the cities feature class. Using a SQL where clause, I filtered the records so only cities classified as County Seats were returned. I then created an empt...

Module 4: Geoprocessing

Image
 In this lab, I created a model in ArcGIS and created a python script to automate geoprocessing tasks. The modelbuilder workflow identified areas within the basin that may be suitable for farming by clipping soils, selecting non-prime farmland, and erasing those areas from the basin. I also created a Python script that added XY coordinated to hospital locations, generated a 1000-meter buffer, dissolved overlapping buffers, and printed geoprocessing messages. This assignment taught me how ArcPy and Modelbuilder can be used together to automate GIS analysis and improve workflow efficiency.  Python script results:  steps used to create script:  1         Import the arcpy module and environment needed to run the geoprocessing tools 2         Set the workspace to Module 4 Data folder to allow script to access shapefiles 3         Enabled overwrite output so existing fi...

Module 3: Error Handling and Debugging

Image
 Module 3 focused on debugging Python scripts. The lab taught me how to identify syntax, runtime and file path-related errors while improving my understanding of troubleshooting techniques and exception handling. Three scripts were successfully debugged.  Script 1  For the first script, I first received a name error stating that ‘fc’ is not defined. To fix this, I changed it to ‘FC’. The second error I received was another Name error stating that field is not defined. To fix this error, I switched ‘fields’ to ‘field’. The script then ran successfully, as shown above. Script 2  The first error received on the second script was a syntax warning on line 15, saying there was an invalid escape sequence (/p). To fix this, I simply fixed the backslash to the proper form. The second error was a name error on line 14, stating that ‘Filepath’ was not described. To fix this, I just had to change ‘Filepath’ to ‘filepath’ because Python is case-sensitive. The third error encounte...

Module 2: Python Fundamentals

Image
  In this week's lab, I learned Python fundamentals through scripting in the notebook in ArcGIS. I worked with variables, loops, lists, and conditional statements. I also had to troubleshoot some errors in the process. The final script, as shown above, generated random integers, simulates a dice game, removed an "unlucky" number from a list using a loop and conditional statements, and printed the final results successfully. This module helped strengthen my understanding of python syntax and working with the notebook in ArcGIS. Also shown above is a flowchart representing the script creation process. The first error I encountered when running the random script was the variable dice was an integer being concatenated with strings, so I fixed it by converting dice to a string using str(dice). The second error was caused by using an undefined variable X, so I corrected x to lowercase x.  Testing the code during the creation of the while loop helped me because the randomly gene...