Friday, July 4, 2014

GIS 5103 Module 6: Exploring & Manipulating Spatial Data


This week's module took us deeper into working with GIS data using Python scripts.  An important initial task was to explore how to check for the existence of data files and, if they exist, to look at their attributes (datatype, for example).  This is something one can do without much thought through the ArcCatalog GUI, but Python also provides easy access if the correct syntax is known.  We then further explored the use and manipulation of lists, tuples, dictionaries, and cursors.  It took me some time to understand how cursors work; they provide access to the rows of GIS attribute tables.  Like lists, cursors can be used in loops to iterate through each row for particular tasks.  The last major task of our assignment was to populate a dictionary using a search cursor and for loop.  The cursor was required to return only certain rows that met the criteria of an SQL query and then return two particular fields from those rows.  The dictionary was then populated with the data from these two fields.  A finishing touch this week was to add print messages throughout the script to provide updates in the interactive window on the status of the operations being run (see screenshot below).  This can be useful with scripts such as this that can take some time to finish.  Without the messages, one will be left in the dark on the status of the script's run.  

This was a challenging assignment that took some time and thought to work out properly.  I appreciated the extra time provided for this module.  



No comments:

Post a Comment