I am trying to replicate with Python/arcpy something that I have done successfully in ArcGIS Pro.
In Pro, I set the Geoprocessing Environment variables Output Coordinate System and Processing Extent. Then I ran RastertoGeodatabase and my imported rasters were clipped to the extent in the right coord system.
Now I am trying to replicate this with arcpy, but the raster is not being clipped. I retrieve the extent of my area of interest and used that to set env.extent:
aoi_fc_desc=arcpy.Describe(aoi_fc)
print(aoi_fc_desc.extent)
arcpy.env.extent=aoi_fc_desc.extent
print(arcpy.env.extent)
with this output:
-124805072.830103 -81922741.1045354 129398239.496769 51189707.7572832 NaN NaN NaN NaN -124805072.830103 -81922741.1045354 129398239.496769 51189707.7572832 NaN NaN NaN NaN
then I ran RastertoGeodatabase:
ST_filelist=glob(join(Landsat_dir,"*_ST.tif"))[0:1]
print(ST_filelist)
arcpy.RasterToGeodatabase_conversion(ST_filelist, gdb_fullpath)
with this output:
['d:\\Users\\crous\\Documents\\Data_Aquisition_GIS_Class\\Tree_Planting_Heat_Island_Analysis\\00_Source_Data\\LST_Landsat8_USGS\\LC08_CU_015016_20150720_20190502_C01_V01_ST.tif']Output Messages
Start Time: Thursday, November 12, 2020 8:49:51 PM
Successfully converted: d:\Users\crous\Documents\Data_Aquisition_GIS_Class\Tree_Planting_Heat_Island_Analysis\00_Source_Data\LST_Landsat8_USGS\LC08_CU_015016_20150720_20190502_C01_V01_ST.tif To d:\Users\crous\Documents\Data_Aquisition_GIS_Class\Tree_Planting_Heat_Island_Analysis\Tree_Planting_Heat_Island_Analysis.gdb\LC08_CU_015016_20150720_20190502_C01_V01_ST_3
Succeeded at Thursday, November 12, 2020 8:50:02 PM (Elapsed Time: 10.83 seconds)