Using Python and ArcPy to transform repetitive GIS editing tasks into scalable, automated geoprocessing workflows.
This project demonstrates how Python and ArcPy can automate geodatabase updates and perform spatial analysis workflows that would otherwise require extensive manual editing. The script processes a local file geodatabase to standardize naming conventions and implement a rule-based traffic policy that adjusts street speed limits based on proximity to schools.

The workflow integrates the following into a reproducible Python script:
- Geodatabase inventorying
- Automated attribute updates
- Spatial selection
- Structured data export
Outputs include a modified geodatabase and a CSV report summarizing speed limit changes for streets located near schools.
Automated geodatabase refactoring
The first part of the project consisted of creating a copy of an existing geodatabase and updating all occurrences of the city name.
Because the name may appear in tables, feature classes, or dataset names, the script first inventories the entire geodatabase using the Walk ArcPy data access function.
walk_result = arcpy.da.Walk(output_gdb, topdown=True)
for dirpath, dirnames, filenames in walk_result:
for filename in filenames:
path = os.path.join(dirpath, filename)
desc = arcpy.Describe(path)
inventory.append((path, filename, desc.dataType))
After identifying all feature classes and tables, the script dynamically finds all string fields and updates records using an UpdateCursor. Field lengths are evaluated and expanded where necessary (using AlterField) to accommodate the longer replacement text.
This approach ensures that attribute values and dataset names can be updated consistently across the entire geodatabase.
Updating street speed limits
The second portion of the project entailed performing a spatial analysis to adjust speed limits based on proximity to schools.
In the script, streets located within 250 meters of schools receive a 10 MPH reduction, while other streets receive smaller adjustments depending on their original speed limit.
Streets near schools are identified using ArcPy’s spatial selection tools:
arcpy.management.SelectLayerByLocation(
in_layer=streets_lyr,
overlap_type="WITHIN_A_DISTANCE",
select_features=schools_lyr,
search_distance="250 Meters"
)
Selected streets are then updated directly using an UpdateCursor:
with arcpy.da.UpdateCursor(streets_lyr, ["FULL_STREE", "SPEED_LIMI"]) as cursor:
for row in cursor:
if row[1] is None or row[1] < 10:
continue
row[1] = row[1] - 10
cursor.updateRow(row)

Exporting a structured CSV
To generate a summary report, the script stores unique street names and their speed changes in a dictionary and exports the results to a CSV file.
with open(output_csv, mode="w+", newline="") as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=columns)
writer.writeheader()
Example of the CSV output table:
| Street name | Original speed limit | Updated speed limit |
|---|---|---|
| Anderson Ln | 40 | 30 |
| Burnet Rd | 45 | 35 |
| Lamar Blvd | 35 | 25 |
This output can support transportation planning or safety analysis workflows.
Summary
This project reinforced the importance of automation in GIS data management workflows. Tasks that would normally require extensive manual editing (e.g., updating attributes across dozens of datasets) can be performed quickly and reliably using Python.
The most challenging aspects involved managing field length constraints and ensuring that duplicate street segments were handled correctly when generating summary outputs.
Overall, the project strengthened my experience with ArcPy cursors, spatial selection workflows, and structured data export.