Module 4: Explore and Manipulate Data
This week, we learned how to direct Python script to utilize the Describe function, Listing the Dataset, and different types of Cursors to Search, Insert, and Update Data to view GIS shapefile's attribute tables.
The Describe function operates to access certain GIS data such as a Shapefile. After we provide access to the Dataset location you can use my.layer = "_shp" and use key terms like mylayer.catalogPath or my.layerbasefile to look at the shapefile's properties.
Listing in Python is very useful if you want to have a result of the different feature classes, rasters, tables, and their fields. We were able to create a list that contains a feature data shapfile's for the Name and their Data Type.
Finally, using Cursors just like viewing an attribute table in GIS, goes through the Attribute's rows and iterates the data. Using cursors can search within the attribute data, insert new attribute data in the attribute table, and update attributes (delete) in the attribute table.
As I am moving through GIS Programming, I learn new methods to reviewing my script. For instance, as you run segments of the script, inspect spacing, and spelling which are very common errors in the script. I also learned in this lab that it is essential to run the script in small sections at a time and isolate the errors that you run into. Python is very consistent to letting the user know which line is the error so you can fix the error.
Script Results
Comments
Post a Comment