I am creating a shp file with the extent of all the raster file in a set of directories and it works fine when all the rasters are in the same projection but not when they switch around.
So I want to first make sure the temp raster extent shape file has the same projection as the raster and then re-project it to overall projection I am using. These re-projected files are then merged to produce one file with all the extents and other info.
The issue is it does not seem to allow me to use the value
desc = arcpy.Describe(File)
spatial_reference = desc.spatialReference
in
arcpy.DefineProjection_management(ShapeFile, spatial_reference)
This gives the following error...
Reading files from C:\arcgis\ArcTutor\Raster\Data\Amberg_tif 12 Changing Directory to: C:\arcgis\ArcTutor\Raster\Data\Amberg_tif\12 Processing 2 files in the directory. [u'090160.tif', u'090161.tif'] Deutsches_Hauptdreiecksnetz_Transverse_Mercator 090160.tif C:\arcgis\ArcTutor\Raster\Data\Amberg_tif\12 Temp_Polygon_Extent_090160.shp Copied Defined Executing: Project C:\arcgis\ArcTutor\Raster\Data\Amberg_tif\12\Temp_Polygon_Extent_090160.shp C:\arcgis\ArcTutor\Raster\Data\Amberg_tif\12\prj_Temp_Polygon_Extent_090160.shp PROJCS['GDA_1994_MGA_Zone_55',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',147.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]] # PROJCS['Deutsches_Hauptdreiecksnetz_Transverse_Mercator',GEOGCS['GCS_Deutsches_Hauptdreiecksnetz',DATUM['D_Deutsches_Hauptdreiecksnetz',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['false_easting',4500000.0],PARAMETER['false_northing',0.0],PARAMETER['central_meridian',12.0],PARAMETER['scale_factor',1.0],PARAMETER['latitude_of_origin',0.0],UNIT['Meter',1.0]] Start Time: Thu Sep 08 13:28:15 2011 Failed to execute. Parameters are not valid. Undefined geographic transformation.
So my question is how do I get the script to automatically choose the transformation when the input spatial ref changes from file to file?
best,