ArcPy for .ecw Upadte Projection

3086
3
06-09-2016 03:14 PM
BehrouzHosseini
Occasional Contributor

I have a .ecw file which is in defined in NAD_1983_UTM_Zone_10N but I need to re-project it to WGS 1984 Web Mercator

I find following code in ESRI website

import arcpy
arcpy.env.workspace = r"C:/Workspace"
arcpy.ProjectRaster_management("image.tif", "reproject.tif", "World_Mercator.prj",\
                               "BILINEAR", "5", "NAD_1983_To_WGS_1984_5", "#", "#")
snapping_pnt = "1942602 304176"


arcpy.ProjectRaster_management("nosr.tif", "project.tif", "World_Mercator.prj", "BILINEAR",\
                               "5", "NAD_1983_To_WGS_1984_6", snapping_pnt,\
                               "NAD_1983_StatePlane_Washington_North.prj")

but not sure if it works for .ecw file too? I am not also sure to what to put in "snapping_pnt"?

Tags (3)
0 Kudos
3 Replies
NeilAyres
MVP Alum

Have you tried just using the project raster tool first, instead of trying to code this in python?

0 Kudos
BehrouzHosseini
Occasional Contributor

Thanks for reply Neil,

Yes Indeed, I tried Project Raster tool but it exports the result in GDB which is not what I am need plus  it is not the ecw fill any more!

0 Kudos
NeilAyres
MVP Alum

The project raster tool can export the projected image into any supported format, not just gdb.

Project Raster—Help | ArcGIS for Desktop

0 Kudos