Module 4 - Geoprocessing
Geoprocessing is a an importent component in GIS. Whether you're a new or advanced user it is an essential set of tools you will use for processing geographic and related data. It offers to perform simple spatial analysis to complex ones. It can also be modeled into a sequence of spatial relationship that will help the user to automatize tasks from one tool to the other and produces a whole new dataset you can use for decision making.
Another component related to geogprocessing is the Model Builder, which I recently have used quite frequently this year. In one of the projects that I'm working on we had to run multiple tools from the input until the end result. And we need to do that everyday, instead of running 10+ tools daily, why not create a model wherein all you need to do is add the input parameters (daily) and run it. It will then publish the end result in my ArcGIS Online profile and there you go I now have an updated dataset I can publish daily. Model Builder is like the flowchartthat helps you visualize your workflow sequence as an easy-to-read flowchart that iteratively process your dataset into your desired output.
In our assignment, we were tasked to create a model that overall returns a soil suitable for farming. We start with clipping the soil data using the basin as the clipping feature. Then, remove the soils that are tagged as "not prime for farmland" and produce a new layer without those features. See model created below:
In addition, we had to also create a python code in the Spyder terminal instead of ArcGIS Pro wherein we are to add XY coordinates in hospitals and create a dissolved buffer of 1000 meter (hospitals). There are actually 3 tools you can do to do this: (1) Add XY, (2) Buffer, (3) Dissolve, but then I know that there's an option in my buffer tool that I can set for it to dissolve the buffer into a single feature without calling the dissolve tool. Here are the arcpy tools I used:
- arcpy.AddXY_management()
- arcpy.Buffer_analysis() *add a parameter to dissolve your output*
- arcpy.GetMessages() *this is added to return print messages of the tools running with start and succeeded time information.
Here's the Ipython console result after running my python code:
Important takeaways for this modules are:
- Importing arcpy module in your stand-alone script but not in ArcGIS Pro
- Allowing to overwrite or no overwrite your existing datasets if necessary
- Use the Auto-Layout and Fit to Window button so you don't have to organize your flowchart in the Model Builder.
- Check the optional parameters you may want to add in your code and note how to skip some if not needed (skip by using empty strings symbolized as ' ')
- For stand-alone scripts don't forget to include the file extension of the data when adding into your code.
Overall, this was an exciting module as we get to experience how we can apply our python lessons in ArcGIS Pro and calling out Geoprocessing tools to run and produce our desired output.
Comments
Post a Comment