Wednesday, June 19, 2024

M5 - Spatial Processes

 Greetings all,

The scripting is getting more complex. The tools and functions being used are getting more involved. This week works with cursors, lists, and dictionaries. Specifically, using a search cursor to find particular information from a feature and then outputting that information for us to view. It is, of course, more involved than that simple sentence conveys. Multiple substeps are utilizing the principles we have built over the past five weeks. 

At its heart, this script is a series of 'for' loops that iterate over some shapefiles, then search through a particular one to pull county, city and population data. Many of the subtasks associated are incorporated into the flow chart below. The flowchart is broken into 5 different parts, with part 3 through 5 being the meat of the assignment. I likely didn't have to subdivide parts 1 and 2, but they were distinct enough to me to do so. I think part 1, environment establishment should be default in most flow charts, and what you do after that is distinct, you wont always be establishing a new file geodatabase as is the case here. Regardless, multiple things could have been incorporated or further subdivided. 



I particularly like to keep a linear flow in my chart where able. There is not any branching logic in this script. All tasks are performed subsequently to another. However, the 3 'for' loops are shown with their accompanying substeps in a square-ish loop of iterable items. It is implied that the loop will execute for each item and then continue along the linear path. 

The two images below are the culminated outputs for the different parts of the script diagramed above.



Note there are two and a half columns of named and described cities which are county seats. These outputs have been condensed into the two images above rather than kept in their original long-length format. Ultimately, as the flow chart shows, a File Geodatabase is created, then numerous features are copied into it, then a search for county seats ran on a particular feature, and finally, a dictionary is populated from those county seats. 
There were a number of scripting challenges, particularly with gathering the appropriate input data for the dictionary and selecting the right variables for the search cursor. But they were ultimately overcome. 

Thank you,

Brandon











No comments:

Post a Comment

Special Topics - Mod 3 - Lab 6 - Aggregation and Scale

 Hello and Welcome back!  My how time has flown. It has almost been 8 weeks, and 6 different labs. There have been so many topics covered in...