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


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?


1 Answer 1


Right now there isn't an automated way to set the transformation. You can add default transformations into the list in the gp environment, which might then be used.

However, you have bigger problems here. Beyond the fact that DHDN (Germany) and GDA 1994 (Australia) don't have any common transformations which means a double transformation, DHDN to WGS84 and GDA 1994 to WGS84, you can't display or project data in one of these coordinate system in the other one. Esri has a 'horizon', a valid area of use for transverse Mercator that is +/-45 degrees from the central meridian. Even if you had a transformation, you'll still end up with an empty output.

You might instead try to create an extent in lat/lon.

  • thanks...sorry the DHDN Germany was just a test data set but all the data I will be analysing is in Queensland and some files cover Australia. They have GCS_GEOCENTRIC_DATUM_of_AUSTRALIA, GDA94_MGA_zone_55, GCS_WGS_1984, GDA94_MGA_zone_55, MGA55, SUTM55, WGS_1984_UTM_Zone_55S. Is it best to retain the extents.shp in GDA 1994 Geoscience Australia Lambert.prj rather than GDA94_MGA_zone_55?
    – GeorgeC
    Commented Sep 8, 2011 at 6:54
  • 1
    @GeorgeC, I was wondering! Transverse Mercator inverse can be not as accurate as one would like once you get around 9-10 degrees from the central meridian. We have a fix for it in ArcGIS 10, but it's still something to watch for. Your data for Queensland just hits that extent. If you're going to go for all of Australia, I would switch to the Lambert-based coordinate ref system.
    – mkennedy
    Commented Sep 8, 2011 at 19:05
  • -thanks for the points...it's unfortunate that there is no way to automate this.
    – GeorgeC
    Commented Sep 11, 2011 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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