python script for Viewshed analysis

3396
1
09-28-2011 03:40 AM
TanjaHumar
New Contributor
Hi,

I have written a wee python script to carry out viewshed analyses for each point of a point feature class.

In the point feature attribute table, I have added OFFSETA, OFFSETB, RADIUS1 and RADIUS2 as variables for the viewshed analysis.

However, it doesn't pick up those variables but uses the defaults (RADIUS1=0 etc). If I generate the viewshed manually it works, but not with the script.

As the point feature class contains hundreds of points, I certainly don't want to generate each viewshed manually! Any help is very much appreciated!!

Tanja


P.S: this is the little script, that works fine otherwise
# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("3D")


# Local variables:
dhm = "C:\\dhm_combined"
Standorte = "C:\\Standorte_3_test.shp"

cur = arcpy.SearchCursor(Standorte)

for row in cur:
    feat = row.Shape
    print row.Nr
    turbine = str(row.Nr)
    vs = "D:\\arctemp\\vs_manuell_"+turbine

    # Process: Viewshed
    arcpy.Viewshed_3d(dhm, feat, vs, "1", "FLAT_EARTH", "")
   
del cur, row
Tags (1)
0 Kudos
1 Reply
JeffreySwain
Esri Regular Contributor
Can you indicate what version of the software you are using?  There is a bug report for version 9.3.1, but it is indicated that it is fixed in version 10.  If you are using ArcGIS 10, please create a support incident to report this behavior.
0 Kudos