SlideServe
Menu
Préférences
© SlideServe · v2026

Python Water Bodies Impairments Tool

ritae avatar
12 diapositives · 178 Views · Nov 01, 2019

Utilize Python to identify impaired water bodies within regional board boundaries and generate information in table format. Extracted data can aid in water quality assessment and management.

Python Water Bodies Impairments Tool - slide 1
1 / 12

Télécharger la présentation

Python Water Bodies Impairments Tool
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Python Final Project: 303d Impairments Laurel Warddrip W1213599 Spring 2015 Geog 375

  2. Project Statement • Goal: Use Python to pull out impaired water bodies within a selected regional water board boundary and quickly get information back in a table format that answered the question..

  3. Project Data Glossary • Impaired Water Bodies: A waterbody (i.e., stream reaches, lakes, waterbody segments) with chronic or recurring monitored violations of the applicable numeric and/or narrative water quality criteria. (US EPA definition) • Regional Water Boards: The State Water Resources Control Board has jurisdiction throughout California. Created by the State Legislature in 1967, the Board protects water quality by setting statewide policy, coordinating and supporting the Regional Water Board efforts, and reviewing petitions that contest Regional Board actions. There are nine regional water quality control boards that exercise rulemaking and regulatory activities by basins. This organization is a result of the landmark Porter-Cologne Act. Source: State Water Resources Control Board Fact Sheet

  4. The Key Data • 2010 303d impaired water bodies • Regional Water Boards

  5. Python Steps • Set up workspace • Set up variables • Creating Feature Layers • Set up proper queries and selections • Create print statements to help check work/count records • Export the product (.dpf file of water bodies)

  6. Setting up Variables # local variables regional_fc = "regions.shp" region_layer = "region_ly" imp_line_fc = "EPAapr_lines.shp" imp_line_layer = "imp_l_layer" out_imp_fc = "out_imp.shp" out_imp_attributes = "out_imp_attrib.dbf“ Challenges: Creating shapefiles, cannot use GDB feature classes. Ensuring naming matches the features names.

  7. Setting up Variables/Print Statements # make a feature layer and check to see if the feature layer exists; if so, delete it for regions and impairments if arcpy.Exists(region_layer): arcpy.Delete_management(region_layer) arcpy.MakeFeatureLayer_management(regional_fc, region_layer) result = arcpy.GetCount_management(regional_fc) print "Number of features in the feature class " + regional_fc + " : " + str(result) Challenges: Forgot to create shapefiles, figured this out and ran smooth. Print statements really helpful and ensured that the correct programming was taking place.

  8. Proper Queries and Selections query = """"HRC" = 'SC'"“" arcpy.SelectLayerByLocation_management(imp_line_layer, "WITHIN", region_layer, "", "ADD_TO_SELECTION") Challenges: Ensured that query made sense using ArcMap, then created the query in python. Also tested the selection logic using ArcMap, helped a lot when completing the correct query to get desired results (took a couple tries).

  9. Export the Product #write out selected imparments to a standalone table that is new if arcpy.Exists(out_imp_attributes): arcpy.Delete_management(out_imp_attributes) arcpy.CopyRows_management (imp_line_layer, out_imp_attributes) print"Copied selected attributes from " + imp_line_layer +" to " + out_imp_attributes Challenges: Ensuring that you use a layer for this part of the code and setting up/using the proper variables.

  10. Code: It worked!

  11. Product

  12. Wrap-Up • This output could be easily added to a website or as part of another analysis. • Could add extra queries and selections for specific water bodies or specific hydrologic units. • Could export to a shapefile to view in ArcMap. • Can be easily updated when a new impaired water body list comes out.