arcpy.env.Extent setting not working

1625
2
Jump to solution
05-20-2021 01:47 AM
Labels (1)
JillBrouwer
New Contributor

Hi, 

when I set the arcpy.env.Extent to be a link to my feature class 

e.g.

dtm = 'C:/Users/brouwerj/Documents/kapiti_1m_dtm.tif'

arcpy.env.Extent = dtm

It isn't altering the extent of the output of the following to be the same as the (larger extent) dtm raster layer. 

buffer = 'shoreline_kapiti_NZGD_1kmBuffer'

arcpy.FeatureToRaster_conversion(buffer, "Shape_length","Buffer_ras",dtm)

I have also tried using arcpy.env.Extent = arcpy.Describe(dtm).extent

but that doesn't work either.

Do you have any idea why this isn't working?

When i try it in the software (Arcgis pro version 2.7.0) it works fine if I change everything in the environment settings tab of the feature to raster tool.

I'm using python 3.7.9 and Spyder 4.2.1 

Not sure if arcpy has a version number or how to access that?

Please let me know if you can help, I'm not sure what I'm doing wrong!

thanks.

0 Kudos
1 Solution

Accepted Solutions
SteveLynch
Esri Regular Contributor
arcpy.env.extent = dtm

 

extent should be lower case.

 

 

View solution in original post

0 Kudos
2 Replies
SteveLynch
Esri Regular Contributor
arcpy.env.extent = dtm

 

extent should be lower case.

 

 

0 Kudos
JillBrouwer
New Contributor

oh wow haha that's embarrassing, sorry for wasting your time ! thanks for the help 🙂

0 Kudos