MapWinGIS:Utils TranslateRaster

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy



This is a thin wrapper to gdal_translate. This utility can be used to convert raster data between different formats, potentially performing some operations like subsettings, resampling, and rescaling pixels in the process. For a full description of the options string, please see the gdal_translate description [1].

Not all the output formats listed at gdal [2] are currently supported. Some common formats that do work are: GTiff (Tiff), BMP (Bitmap), AAIGrid (ASCII Grid), HFA (Erdas Imagine), GSAG (Golden Software ASCII Grid).

C# Usage

bool TranslateRaster(string bstrSrcFilename, string bstrDstFilename, string bstrOptions, MapWinGIS.ICallback cBack)


bstrSrcFilename string
bstrDstFilename string
bstrOptions string
cBack MapWinGIS.ICallback
Return Value bool

C# Sample Code

  using MapWindow.Interfaces;
  using MapWinGIS;
  using System.Windows.Forms;
  using Microsoft.VisualBasic;
  using System;
  public static class MyExample // Translates a Tiff grid to an ESRI ASCII Grid
        public static void ScriptMain(ref IMapWin m_MapWin)
                MapWinGIS.Utils u = new MapWinGIS.Utils();
                bool result = false;
                string myFolder = @"c:\temp\";
                result = u.TranslateRaster(myFolder + "mySourceFile.tif", myFolder + "myDestinationFile.asc", "-of AAIGrid", null);
                if (result) {
                        MessageBox.Show("Translate completed");
                } else {
                        MessageBox.Show("Translate failed");

Back to MapWinGIS.Utils

Retrieved from ""

This page has been accessed 1,106 times. This page was last modified on 11 November 2009, at 07:42.