GIS5103 - Module 4 - Geoprocessing
For this week's lab, we learned to use Model Builder and geoprocessing tools in scripts. The Model Builder was very similar to the flowchart we had been making, but it had more functions that allowed us to basically make a script using visual methods. The first assignment of the module made us clip all soil layers to a basin shapefile, then select all soils that were classified as "Not prime farmland" using an SQL query, and then erase the not prime farmland from the basin polygon. I thought it was very intuitive to build code this way. You don't necessarily have to write the code line by line, but just interact with the ModelBuilder flowchart interface.
For the second part of the assignment, we were assigned to add XY coordinates to a shapefile, then create a 1000-meter buffer around this feature, and finally dissolve the buffer into a separate single feature. We learned to use "/n" which added spaces to the print function. We also learned to use the GetMessage() function, which retrieves any message generated by the function, even errors and warnings. We also learn the importance of overwriting outputs. Enabling overwrite avoids the need to manually delete outputs before re-running a model or script. Overwriting ensures the script works without manual cleanup. It also keep your workspace clean by avoding repeated file names like Clip_1, Clip_2, Clip_3. We also learned about workspace and where outputs are placed into.

Comments
Post a Comment