0

I in my Kernel Density Loop i want the Processing Extend to be Default + 5000m

Does anyone know how this might be done?

This is the Code:

import arcpy,os
from arcpy import env
from arcpy.sa import *
env.workspace = r'C:\Users\lhark\Desktop\SHK\ArcGis_Proj_Canada\shapefiles'
outworkspace = r'C:\Users\lhark\Desktop\SHK\ArcGis_Proj_Canada\KernelDensity'
fcList = arcpy.ListFeatureClasses ()
for fc in fcList:
    outKDens = KernelDensity(fc,"NONE",500,500,"SQUARE_KILOMETERS","EXPECTED_COUNTS")
    outKDens.save(outworkspace + "/" + os.path.splitext(fc)[0] + "_kd.tif")
1

You could probably do something like this, since the default processing extent is based on the extent of the feature class.

for fc in fcList:
    fcext = arcpy.Describe(fc).extent
    env.extent = arcpy.Extent(fcext.XMin-5000,fcext.YMin-5000,fcext.XMax+5000,fcext.YMax+5000)
    outKDens = KernelDensity(fc,"NONE",500,500,"SQUARE_KILOMETERS","EXPECTED_COUNTS")
    outKDens.save(outworkspace + "/" + os.path.splitext(fc)[0] + "_kd.tif")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.