Sunday, June 23, 2024

Mod 6 - Geometry Processing

 Greetings all,

And just like that, this half-semester is about over. Welcome to module 6, working with geometry processes. The goals here are to explore the geometry objects associated with point, line, polygon, single and multipart features. The end deliverable and goal of the module was to create a search cursor which iterates over a river based shapefile. It then writes the associated vertex location information into a text file. It does this by utilizing a nested for loop. 

Below is a pseudo code representation of the process: 

Start

            Import Modules
                        arcpy, fileinput, string, OS, env

            Define workspace.

            Create SearchCursor for “OID”, “SHAPE@”, “NAME” within desired feature class.

            Create or Identify text file for writing results too.

            Utilize for loop to iterate through each row in cursor

                        Define VertexID for sequential vertices processing

            Utilize nested for loop to iterate through each point in row.

                        getPart() to iterate through each object.

                        Add +1 to previous point in row to continue iteration..

            Write SearchCursor output to the text file.

            Close text file.

            Delete Row

            Delete Cursor

End

The above shows the flow of the script. Note it doesnt include things like print statements designed to highlight script process. Another thing it doesnt do well is show the nested nature of the for loops. However, this is overcome with the flowchart below. 




The nested loops are more prominent above, and highlight the majority of the script processing. Aside from those loops this script is more simplistic than some of the previous, really incorporating only 3 tasks. Create a Text file, iterate over a shape file for the name, ID, and vertices information, and output it. Here is a sampler of the final output. 



For the above result we can see that the object had 25 individual features with varying amounts of vertices. But the goal was to open, write, and export that information to a shape file. Lastly, we have a snippet from the corresponding text file. 


For as simple as the process was, there are several different components to it. Its definitely amazing how far the processing and understanding of it has come in a few short weeks. Thank you much, and good luck in the next class.

v/r

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...