I'm new in python scripting in ArcGIS but not Model Builder. I'd like to know what's the benefits of Python VS Model Builder. Why should we write script for GIS automation while we can use Model Builder? What are the automation capabilities of Python that we can't find in Model Builder?
I believe that the user should clearly define their objectives before deciding which set of tools to use. ModelBuilder and Python scripting excel at different tasks. A few thoughts:
On the other hand:
|
|||||||||||||||||||||
|
If you are working solely within the confines of ArcGIS, there are a few considerations I would consider when attempting to determine the approach to take.
Given those considerations:
There probably is no answer to "which is better" for personal use, but if you are looking long-term at employment possibilities, by learning Python you will set yourself apart from those who only know how to use the pre-programmed tools, or just know how to use ModelBuilder. You also give yourself the ability to go outside the confines of Python for ArcGIS (ArcPy), and start automating far more tasks and projects by using other proprietary and open-source GIS libraries, as well as many non-GIS libraries (ie- database, image manipulation, statistics, etc). |
||||
|
When using Python and ArcGIS, you get the entire functionality of Python in addition to what you already had in ArcGIS. If you need this kind of power and flexibility depends on your wishes. In addition, getting to know and really leverage a programming language such as Python takes time. If this investment is worth it for you is up to you. However, for serious data processing a real scripting language is a very good addition in your arsenal. Apart form any functionality that the ModelBuilder might miss, there is also a more fundamental discussion. In general, scripts are much more suitable to create complex workflows. The code is processed from top to bottom, and complex tasks can be subdivided into smaller sub tasks using e.g. functions. or objects. A graphical tool such as the model builder tends to become a big spaghetti. |
|||
|
I'm partial to creating Python scripts. It's more fun to write code than to mess around with connecting lines to boxes and such, for me at least. What's really great about Python scripting is you can schedule your scripts to run at a time that is convenient for you. If you have a script that takes a while to complete, or needs to be run outside of regular business hours, this is really convenient. You can see an example of how to schedule a script here. And as @Aaron mentions, you can easily set up looping in a Python script. If you're just setting out with Python scripting, you might want to create a model with Model Builder and export it as a Python script. I do this sometimes if I'm having trouble understanding how to use several tools in a script. It could help you get a sense for how to put scripts together. |
||||
|
Model Builder is a great and easy to learn visual programming language and a good entrance to GIS-programming in general. But in some things python can do more. One example is the integration of non-ESRI GIS libraries. Nearly all of the Open Source GIS can be adressed via python as well (e.g. GRASS, Sextante, QGIS, SAGA). This helped me a lot, because I only have an ArcView license. So every time I cannot use a certain geoprocessing tool in ArcGIS, I look what other options are available in Open Source GIS. I then take these OpenSource-tools and combine them with ArcGIS tools either in a bigger python script or integrate them in ModelBuilder via a smaller python script. I´m sure other members can name more advantages. |
|||
|