Geoprocessing Service - ModelBuilder vs. Python

1864
4
07-20-2017 06:42 AM
VishalShah2
Occasional Contributor II

So I have been tasked with creating a geoprocessing service for my company but I am trying to figure out which would be better to create it with, ModelBuilder or Python. Looking for pros and cons of using either one if anyone can help with that.

0 Kudos
4 Replies
RebeccaStrauch__GISP
MVP Esteemed Contributor

Like many things, I think a lot of it would depend on your skill/comfort level and the task you are trying to make into a GP service.  However, my preference would always be Python since you can tweak things easier.  Model Builder can be used to setup your workflow, then you can convert it to Python and continue tweaking/refining.  My opinion.

GregWhite2
New Contributor III

I do both: My workflow is to start in model builder AND then if the logic is hard to do in model builder OR for performance reasons I will create a python script for just the portion of the project that NEEDS it; I keep the script integrated with the model giving the benefits of both.

Integrating scripts within a model—Help | ArcGIS for Desktop 

curtvprice
MVP Esteemed Contributor

I think this is the same advice you'll see on scripting a process with Model Builder vs Python. My main advice is if you have do deal with multiple nested loops, complex if then branching, or need full control over parameter validation, Python is the way to go. If you don't need these capabilities to get it done, Model Builder may meet your needs, quickly and easily.

I'm totally in agreement with Greg the others that with Model Builder you can't go wrong, an exported model or even just a workflow documented with Model Builder (Pro can't export model builder to python ) is very easy to jump over to Python if the need arises.

KevinBell1
New Contributor III

...and it should be pointed out that if you hit the wall of MB's capabilities (which is easy to do) then python is your solution.  Python allows control over your OS, so creating directories, moving files, etc.  You can read your GIS data and format a spreadsheet, or send email, or call another program up, etc.  MB is really GIS centric, but in many cases your needs deal with GIS but may include other things to.