Sunday, July 14, 2013

Geometry and Rasters


We're starting to get into the nuts and bolts of reading and writing feature classes now. Part 1 of the assignment this week involved reading out the components of a shapefile and writing those to a text file.  This was a pretty straightforward assignment, though there are some subtleties with getting the "parts" of the geometry out of the shapefile.

Part 2 involved working with rasters.  I really wish we had more time for this topic as I think I will be working with rasters a lot in the future and I feel like we are only scratching the surface here.  The goal was to read in a raster and then apply various raster functions (slope, aspect - with varying conditionals) to create a new raster based on the combination of temporary rasters.  The end result appears above.

Finally, for grad students, Part 3 involved reading in the "parts" that we originally wrote out to a text file in Part 1 and build a new feature class.  This was actually pretty challenging.  While my code works and appears to match the desired outcome, I'm not completely happy with it.  One thing I don't understand is why the rows in the attribute table do not match the order that they are read in (and the order of the OID that they had in the text file).  I imagine there is some sort of object referencing/ordering going on that is outside our control, but it is somewhat troubling not having that level of control.  Overall, a good assignment this week and exposed a lot of the power of arcpy and GIS programming.

No comments:

Post a Comment