Select to view content in your preferred language

python and spatial analyst

352
1
Jump to solution
11-05-2013 01:18 AM
WillemVerhagen
New Contributor
Hi all,

Hope you can help me. i'm doing the online course intro to spatial analyst in ArcMap 10.1.
I have the spatial analyst toolbox installed and active trough the customize windows.

However, when I try to use a command in the python window, e.g. slope, the command is not recognized and I receive an error message. So probably I should load or activate something. however, this is not explained in the intro excercise so I'm rather stuck and could not find anything in the help files.

probably a silly easy question but i hope something is willing to help me out
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor
Hi all,

Hope you can help me. i'm doing the online course intro to spatial analyst in ArcMap 10.1.
I have the spatial analyst toolbox installed and active trough the customize windows.

However, when I try to use a command in the python window, e.g. slope, the command is not recognized and I receive an error message. So probably I should load or activate something. however, this is not explained in the intro excercise so I'm rather stuck and could not find anything in the help files.

probably a silly easy question but i hope something is willing to help me out


Hi Willem,

In order to use the "Slope" command you can either write:
arcpy.sa.Slope(in_raster, {output_measurement}, {z_factor}) # using the Slope function from Spatial Analyst


or:

arcpy.Slope_3d(in_raster, out_raster, {output_measurement}, {z_factor}) # using the Slope function from 3D Analyst



...or import the sa (Spatial Analyst) module and call the Slope function directly:

from arcpy.sa import * Slope(in_raster, {output_measurement}, {z_factor})


Kind regards,

Xander

View solution in original post

0 Kudos
1 Reply
XanderBakker
Esri Esteemed Contributor
Hi all,

Hope you can help me. i'm doing the online course intro to spatial analyst in ArcMap 10.1.
I have the spatial analyst toolbox installed and active trough the customize windows.

However, when I try to use a command in the python window, e.g. slope, the command is not recognized and I receive an error message. So probably I should load or activate something. however, this is not explained in the intro excercise so I'm rather stuck and could not find anything in the help files.

probably a silly easy question but i hope something is willing to help me out


Hi Willem,

In order to use the "Slope" command you can either write:
arcpy.sa.Slope(in_raster, {output_measurement}, {z_factor}) # using the Slope function from Spatial Analyst


or:

arcpy.Slope_3d(in_raster, out_raster, {output_measurement}, {z_factor}) # using the Slope function from 3D Analyst



...or import the sa (Spatial Analyst) module and call the Slope function directly:

from arcpy.sa import * Slope(in_raster, {output_measurement}, {z_factor})


Kind regards,

Xander
0 Kudos