140 likes | 257 Views
Annie Chang. Improving workflow at CNDDB. California Natural Diversity Database. Natural heritage program Map rare plants and animals http://www.dfg.ca.gov/biogeodata/cnddb/. Work is time-consuming. Purpose. Automate part of the workflow using python script. Select by attributes.
E N D
Annie Chang Improving workflow at CNDDB
California Natural Diversity Database • Natural heritage program • Map rare plants and animals • http://www.dfg.ca.gov/biogeodata/cnddb/
Purpose • Automate part of the workflow using python script
Select by attributes • Needed to select new records that are not yet buffered (Source_Feature = N)
Append • Each time the script runs, the buffer feature class would be deleted and recreated • Save the results of the buffer in the feature class SOURCE_FEATURE through append
Calculate Field • Needed to mark the records as processed • Values of Source_Feature were changed from “N” to “Y”
Dissolve • Occurrences are summaries of detection areas for particular species
Obstacles • When to put single, double, or no quotes around variables • Text values for the CalculateField operation needed double quotes
Obstacles (continued) • Originally, the buffer was done on the entire source layer. Then, I realized if I were to add additional records to the source layer (like when we receive new data at CNDDB), there is no way to only buffer the new data. I added a new field “Source_Feature” that had values “Y” or “N” to indicate whether this record has already been buffered and saved in the SOURCE_FEATURE feature class.