[FWTools] Batch translating from .ecw to geotiff in Australian Map Grid

Richard Greenwood richard.greenwood at gmail.com
Wed Dec 17 02:42:44 UTC 2008


On Mon, Dec 15, 2008 at 5:22 AM, tonyf <tony at physsi.com.au> wrote:
>
> I figured the best thing is to do the simple convert below then edit the ers
> file (or the Mapinfo Tab file) using notepad or whatever to replace the
> reference to the .ecw file with the ref to the tif resulting below.
>
> It's not really a geotiff I think but it gets me out of trouble.
>
> Actually I used a visual basic script to do a batch replace in the tab
> files.  Find the script here:
> http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0208.mspx
> http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0208.mspx
>
> Used a for loop in the FWTools Shell: for %a in (*.tab) do cscript
> replace.vbs %a ".ecw" ".tif"
>
> Similarly for the conversion: for %a in (*.ecw) do gdal_translate %a
> %~na.tif
>
> I owe something to  http://www.allenware.com/icsw/icswref.htm#FunctionGroup
> http://www.allenware.com/icsw/icswref.htm#FunctionGroup  for help on for
> statements and the %~na bit particularly.
>
> So I'm out of trouble, but is there a way to convert ecw+tab or tif+tab or
> ecw+ers to geotiff?

Try
-a_srs srs_def:
    Override the projection for the output file. The srs_def may be
any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a
file containing the WKT.

See:
    http://www.gdal.org/gdal_translate.html

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the FWTools mailing list