Project Raster Error

1679
1
07-02-2014 06:51 AM
HayleySolak
New Contributor
I'm trying to just do a simple project raster operation using Arcpy. This is a test of a small piece of a larger code. i keep getting the following error:

ExecuteError: ERROR 000622: Failed to execute (Project Raster). Parameters are not valid.
ERROR 000628: Cannot set input into parameter out_coor_system.

Personally, I have experience with Python but I'm still shaky on Arcpy syntax so i'm probably making a silly mistake somewhere.

Code is below:

import arcpy
from arcpy.sa import *

arcpy.env.overwriteOutput = True
arcpy.env.workspace = 'H:\FORMA_TEST'
arcpy.CheckOutExtension("Spatial")

in_coor = "Geographic Coordinate Systems/World/WGS 1984"
out_coor = "Projected Coordinate Systems/UTM/WGS 1984/Southern Hemisphere/WGS 1984 UTM Zone 18S"

arcpy.ProjectRaster_management("Hansen_0080.tif", "Hans_0080prj3.tif", out_coor,"","", "", "",in_coor)
Tags (2)
0 Kudos
1 Reply
IanMurray
Frequent Contributor
try


out_coor = "PROJCS['WGS_1984_UTM_Zone_18S',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',-75.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]"



from the tool help:

The coordinate system to which the input raster will be projected. The default value is set based on the Output Coordinate System environment setting.

Valid values for this parameter are

A file with the ".prj" extension (the prj files which ship with ArcGIS can be found in "C:\Program Files\ArcGIS\Coordinate Systems").

An existing feature class, feature dataset, raster catalog (basically anything with a coordinate system).

The string representation of a coordinate system. These lengthy strings can be generated by adding a coordinate system variable to ModelBuilder, setting the variable's value as desired, then exporting the model to a Python script.


I generated this from model builder by making a new coordinate system variable and selecting the one you needed.
0 Kudos