Select to view content in your preferred language

Set raster layer resampling using python script

627
4
05-11-2023 07:54 AM
KristieReece
New Contributor III

I have created a python script that creates a series of point layers and kernel density layers. I want to set the rendering resamplying type to cubic for this density layer. After doing a bit of googling all I have found is the arcpy.management.resample (https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/resample.htm), but I am looking to resample the rendering as seen is this screen capture. The resampling technique in the link, does not appear to be the same as the one in the screen capture. Any assistance would be greatly appreciated!

KristieReece_0-1683816808257.png

 

 

 

0 Kudos
4 Replies
ChrisRingo
Occasional Contributor

Looks like the resampling method you're looking for is maybe in the environment settings? https://pro.arcgis.com/en/pro-app/latest/tool-reference/environment-settings/resampling-method.htm

0 Kudos
KristieReece
New Contributor III

Hi Chris,

I executed the code from that link, but I'm not entirely sure what it is changing. I ran the Kernel Density tool again and it still produces the same output. I will investigate it a bit further though as this was not a resource I had previously seen. Thanks for sharing it!

Best,

Kristie

0 Kudos
RhettZufelt
MVP Notable Contributor

I believe the resampling method environ setting only applies to GP tools that honor that setting.

When you set Resampling Type in the Raster layer Rendering tab as in your attached pic, that is only for displaying the raster, and doesn't change the data at all.

You can change the default method in the options so that it will always render raster with that type, but don't know of a way to get at this with code.

RhettZufelt_0-1683830881870.png

 

R_

 

0 Kudos
KristieReece
New Contributor III

I updated those settings as displayed in your image, unfortunately, it still does not provide the smoothed visual that the rendering tab setting achieves. Thank you for the info! I suppose we will just have to edit that setting by hand.

0 Kudos