AnsweredAssumed Answered

What is the difference between arcpy.gp.Visibility_sa and arcpy.sa.Visibility

Question asked by peterlen on Apr 16, 2015
Latest reply on May 28, 2015 by curtvprice

Hello - We are using ArcGIS v10.2.  I have been playing with the spatial analyst Visibility tool.  I am writing my own Python script tool and so wanted to see how ArcGIS would list the Visibility tool call so I built a model where I dragged the Visibility (spatial analysis) tool to my model and then added all of the tool's parameters.  It all ran fine and si I exported it to a Python file.  The python file listed the tool as:

 

arcpy.gp.Visibility_sa()  which took 18 arguments.

 

When I looked at the help file for this tool, the python code example looked like:

 

ret = arcpy.sa.Visbility() which took 17 arguments.  The definition above included an output raster as the 3rd argument and is why it took 1 more argument than this version.  This version, does not take a raster output option, but instead returns a raster type.

 

Both seem to create the same output but I am confused as to why there are two different versions.  I could not find anything on an arcpy.gp module so am unsure of where the arcpy.gp is being read from.

 

The odd thing is that in my ArcMap's Search window, when I find my Visibility (spatial analysis) entry, the help link shows an example of the second type (arcpy.sa.Visibility) but the link that points me to the tool int he toolbox, which I dragged to my model, and which I exported as a Python script, lists the first type (arcpy.gp.Visibility_sa).

 

Any thoughts?

 

Thanks - Peter

Outcomes