Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

viewshed ArcMap crashes when adding layer

$
0
0
I'm having a fitful time trying to add the resulting raster to my map doc. The Viewshed always writes an 'autonamed' raster file to my scratch db, i don;t seem to be able to control the name of the resulting file.

When i run MakeRasterLayer_management the file saves deep in a temp dir, never to be seen again. And when I do get a layer created ArcMap crashed every time I add the layer.

I could use a little help here to set me on the right path.

Thanks

Jon

Code:

# Set enviroment, frames and layers
arcpy.env.workspace
arcpy.env.scratchWorkspace
scratchdb = arcpy.env.scratchGDB
scratchfdr = arcpy.env.scratchFolder

if arcpy.CheckOutExtension('Spatial'):
    if arcpy.GetCount_management(inObserverFeatures) != 0:
        outViewshed = Viewshed(clippedraster, inObserverFeatures, zFactor, useEarthCurvature, refractivityCoefficient)
        outViewshed.save()

        rQuery = '{0} > 0'.format(arcpy.AddFieldDelimiters(outViewshed,"Value"))
        arcpy.MakeRasterLayer_management(outViewshed,'Cell_Ping_View',rQuery)

        arcpy.mapping.InsertLayer(frame,reflayer,outViewshed,'AFTER')


Viewing all articles
Browse latest Browse all 2485

Trending Articles