Tips and Tricks

Please share how to crop/subset/crop SRTM data using Global Mapper?

Bismillah, try this step

1. Open your GM and load your SRTM data

2. Load your .shp vector data for bound (this file you will use to crop the SRTM data) >> make sure it has the same projection system with SRTM data

3. Zoom in, and move your cursor to “Digitizer Tool”

4. Select the vector data using “Digitizer Tool”. Selected area will be show like figure below (lozenge/rhomboidal)

5. File – Export raster and elevation – Export DEM (USGS DEM format)

6. in DEM Export Option window, select tab “Export Bound” >> click “Crop to selected area features” >> OK

7.  Save with your desire file name





Do you know how to divide the WorldView 2 imagery (8-band) into single band? I need every single band to apply the algorithm.

OK. We can try spectrally subset the image and resave each band subset individually.

On ENVI, it could be done by:

– Basic Tools > Resize Data (Spatial / Spectral).

– Input file (our MultiSpectral image).

– For Spatial Subset, the default is Full Scene.

– Leave this as is since we want the entire scene spatially.

– For Spectral Subset, click on the button and select band 1 (one band at a time, from 1 through 8 ) > OK > OK.

– Resize Data Parameters window opens.

– Change Resampling to Bilinear (from Nearest Neighbour).

– Enter output file name location and click OK.

Hopefully this could help us (:





Clip to a Graphic Shape

Making Rasters More Manageable


In the Export Raster Data dialog box, set parameters such as cell size, output file format, and spatial reference.
In the Export Raster Data dialog box, set parameters such as cell size, output file format, and spatial reference.

Make raster datasets more manageable by clipping rasters in ArcMap using a graphic you draw as a template. Draw any graphic shape and use that shape to clip out just the extent you want. Export this clipped raster as a BMP, GIF, GRID, IMAGINE, JPEG, JPEG 2000, PNG, or TIFF file. This functionality is very useful for quickly and easily defining a study area.


  1. Draw the graphic that you will use for clipping the raster using the tools on the ArcMap Drawing toolbar. Leave the graphic selected.
  2. To clip and export the raster dataset based on this graphic, right-click the raster layer in the table of contents. Choose Data > Export Data from the context menu.
  3. In the Export Raster Data dialog box, click the radio button next to Selected Graphics (Clipping). Set the Spatial Reference to either the Data Frame or the raster dataset.
Clip a raster to any shape you create using ArcMap software's drawing tools.
Clip a raster to any shape you create using ArcMap software

If desired, check the Force RGB box to export the output raster as a three-band RGB raster dataset with the current renderer and specify a NoData value for the output. The default cell size is the dataset’s original cell size.

Browse to the location to save the exported raster dataset, name it, and use a raster format. If the output location is a geodatabase, the output type will automatically be the correct geodatabase type.


It’s easy, isn’t it….

Enjoy image processing with ArcMap









The Enhanced Compressed Wavelet (ECW) technology is great stuff. It makes it possible for a lot more people across an organisation to get access to valuable imagery, and that imagery can be Gigabytes or even Terabytes in size.

Disclaimer: This post has been recreated from an article that was on the old Digital Earth Pty Ltd website. The original article was last updated on 30 June 2001. Some minor changes have been made in this version, but some of this information may be out of date. All the products mentioned have definitely evolved.

This article aims to help you get the best results from your ECW compression. It is aimed at users of colour (RGB) imagery. It does not attempt to cover detailed system requirements for processing and compressing large mosaics.

ECW Compression Tools

There are two options for ECW compression:

Free ECW Compressor

The Free ECW Compressor can be used to compress single files of up to 500 Mbytes in size (uncompressed). It does not support the compression of mosaics or batch compression, but is suitable for manually compressing small files.

You can download the Free ECW Compressor, and free ECW viewing plug-ins for many common GIS, CAD and office applications, from the ER Mapper download page.

ER Mapper

If you want to compress larger files, perform batch compression of multiple files, or follow the:

  1. orthorectify,
  2. mosaic,
  3. colour balance, and
  4. ECW compress


processing steps then the software you need is ER Mapper. ER Mapper is available resellers around the world.

The ECW compressor is constantly being improved by Earth Resource Mapping. Before starting a compression project please make sure you have the latest version of the software you are using.

Target Compression Ratio vs Actual Compression Ratio

Before we get into the details of getting the best from your ECW compression it is important to understand compression ratios. The ECW compressor asks the user for a “target compression ratio” (labelled below as “Desired compression ratio”), not a resulting “actual compression ratio”.

ECW is not a lossless compression technique. It achieves its very high compression ratios by discarding some of the high frequency information in your image. The numeric value you enter for the target compression ratio is used during the compression process to determine how much of that high frequency information is discarded.

The ECW compressor will produce ECW files of consistent image quality if you use the same target compression ratio. The actual compression ratio achieved depends on the amount of information in your image. An image with few changes in texture and contrast (e.g. an aerial photograph of grasslands) will compress to a higher actual compression ratio than a very complex image (e.g. an aerial photograph of a dense urban area). Therefore, the resulting ECW images will be different sizes.

It may help to think of the target compression ratio as an “inverse quality index”. The higher the target compression ratio the lower the quality.

Maximising Image Quality

Compressing Once is Best

Since ECW compression is not lossless it is always best to compress your image data only once to minimise the loss of quality. Always compress the original data whenever possible. (Please do not delete any of your original data after producing ECW files! Archive them on reliable media.)

Multiple Compression is Sometimes Required

Sometimes there are reasons for having to compress imagery more than once. The classic case is when you are working on a very large mosaic but do not have the hard disk space to load all the source images at once. To get around this you can use ER Mapper to create and compress “sub-mosaics”, and then re-compress the sub-mosaics into the final large mosaic.

The trick to minimising loss of quality is to re-compress the sub-mosaics at an integer multiple of their idividual target compression ratios. For instance, if you want to use a final target compression ratio of 20:1 then you would compress the sub-mosaics at 5:1 (n = 4), 10:1 (n = 2), or 20:1 (n = 1).

Example: Suppose that you had 200 Gbytes of data that you wanted to mosaic, at a target ratio of 20:1, but you only had about 80 Gbytes of disk space. I would split the mosaic into four sub-mosaics of about 50 Gbytes each and then process them as follows:

For each sub-mosaic:

  1. Load source images onto your hard disk.
  2. Use ER Mapper’s Image Display and Mosaic Wizard to mosaic the source data.
  3. Colour balance, if required.
  4. Compress the mosaic at 10:1.
  5. Delete the source data, keep the ECW file.


Use ER Mapper’s Image Display and Mosaic Wizard to mosaic the ECW files produced by compressing the sub-mosaics. Compress the final mosaic with a target ratio of 20:1. Note: Re-compressing ECW data takes longer than compressing TIFF or ERS files because the data has to be decompressed from the sub-mosaic images before it can be compressed into the final mosaic.

Different Data Types

To get the best quality ECW files you need to consider the type of image data you are compressing. You can break image types into two groups — earth observation and cartographic.

Earth Observation

These are images that have texture, where adjacent pixels are likely to have different values. For example:

  • Aerial photography — colour and grayscale
  • Satellite imagery — pseudo-colour and other non-classified RGB derivatives.


The ECW compressor is optimised for these type of images. Selecting a target ratio of 20:1 or 25:1 for colour imagery, and 10:1 for grayscale, will result in good quality images.

The ECW compression process tends to visually “flatten” RGB images when higher compression ratios are used. To improve the visual display the ECW decompressing application will add random visual noise to the image during the image viewing process — if it was compressed at a target ratio of 10:1 or higher. This is designed to improve the perception of image texture. Note: The “visual noise” is not actually present in the ECW file, is introduced via the decompression/viewing process.

Note: This is a problem for some cartographic style images. (See “Cartographic” below.)

Since the visual noise is added by the decompressing application it will not be added twice to an ECW file that is the result of multiple compressions. An example of how you would have the visual noise added twice is:

  1. Compress the image to ECW.
  2. View the image (visual noise gets added) and then save the image to another format (the saved image has the visual noise saved as well).
  3. Compress the newly saved image to a new ECW file.
  4. View the new ECW file (visual noise gets added again).



These are images that often have large areas containing uniform colour values, and where adjacent pixels are most likely to have the same values.

For example:

  • Scanned topographic maps
  • Rasterised vector data. e.g. cadastre
  • Classified satellite imagery


These type of images require additional care during compression in order to maximise display quality. We do not want the decompressor to add random noise to these images if they are compressed at 10:1 or higher. We want nice big blocks of uniform colour.

There are two ways to avoid the random visual noise issue:

  • Compress as RGB and use a target compression ratio of less than 10:1, or
  • Compress the data as Multiband instead of RGB.


You should also find that these style of images compress very well. It is not uncommon to get actual compression ratios more than double the target compression ratio.

Notes on Multiband: Typically, multiband ECW images containing 3 bands are approximately 1/3 larger than their equivalent RGB version. When compressing an RGB image the compressor takes advantages of special techniques applicable to red/green/blue imagery which result in an additional reduction in file size.

Calculating the Size of Mosaics

Input Size

If you are compressing a mosaic using ER Mapper calculating the size of that mosaic becomes important for Image Web Server users. Their licence may restrict them to serving images of a certain size before they were compressed.

The ECW compressor works on a line-by-line basis, which is why it does not require a lot of memory to compress very large mosaics. The compressed data is stored in the ECW file as a pyramid of data blocks (ECW is not a tile based format — there is a whole bunch of mathematics involved which I don’t fully understand, and is therefore beyond the scope of this article.)

Each line of image data, that is being compressed, needs to be the same length. Therefore, the extent of the input mosaic is its bounding box.

ER Mapper can handle the display and compression of images with different cell sizes. For example you can display aerial photography and satellite imagery in one mosaic, and you can compress it. The point to note is that in order to do this
the compressor must have a uniform cell size across all images in the mosaic. This must be the minimum cell size used by all images in the mosaic.

Calculating the size of an input mosaic requires:

  • Width of the bounding box (width).
  • Height of the bounding box (height).
  • Minimum cell size in the mosaic (cellSizeX and cellSizeY).
  • Number of bands to be created in the ECW file (numOfBands).


The following factors are ignored:

  • Image overlap. (Only data that contributes to the mosaic is included.)
  • Compressed images — all compressed data (e.g. LZW TIFF, ECW files) are decompressed and then recompressed so you may have a saving in disk space but there is no saving in the size of the input image.


Green = 10cm cell size, Yellow = 20cm cell size, White = no data.

In the above image the yellow images will be sub-samples to 10cm cell sizes during the compression process. This effectively increases the size of those images by a factor of four, but they will compress quite well.

To calculate size of a mosaic image before compression use this formula (the same linear unit of measurement must be used for all dimensions):

numOfBytes = ((width / cellSizeX) x (height / cellSizeY)) x numOfBands


size in Gigabytes = numOfBytes / (1024 x 1024 x 1024)

Output Size

As mentioned above, the final size of an ECW file depends on he target compression ratio, the information in the image, and several other factors:

  • Compression type: RGB or Multiband (also mentioned above)
  • Whether it was optimised for Internet use.


If you are going to serve your ECW files using Image Web Server then you can increase performance by telling the compressor to optimise for Internet use. This reduces the size of the data blocks in the ECW file from 512×128 to 64×64, but increases the size of the “Block Offset Table” in the header of the ECW file. The result is approximately a 10% increase in file size.





Simple Threshold Overlays

Display a Landsat TM RGB algorithm
1 On the Standard toolbar, click on the Open button.
An image window and the Open Algorithm dialog box appear.
2 From the Directories menu, select the path ending with the text \examples.
3 Double_click on the ‘Data_Types’ directory to open it.
4 In the directory named ‘Landsat_TM,’ load the algorithm named ‘RGB_321.alg.’
This algorithm displays an RGB color composite of bands 3, 2 and 1 of a Landsat TM image
covering a portion of the San Diego, California metropolitan area. The dark areas in the lower
portion are ocean.
5 Click on the Edit Algorithm button to open the Algorithm window.

Add a Classification layer and load the Landsat image

1 On the Algorithm window, select Classification from the Edit/Add Raster Layer
A Classification layer is added to the layer list.
2 Click the Load Dataset button in the process stream diagram for the new layer
to open the file chooser dialog.
3 From the Directories menu, select the path ending with the text \examples.
4 In the directory named ‘Shared_Data’, load the image named
This is the same image loaded in the RGB layers of the algorithm. You will use a formula to define
a threshold one band of the image and display the result as a color overlay.
5 Turn off the classification layer by right-clicking on it and selecting Turn Off.
The classification currently covers the image with an all white layer. Turn it off for the moment to
make the image visible.
Determine the threshold value for ocean areas
Next you will use traverse extraction to determine a data threshold between land and ocean areas
of the image using band 5 of the Landsat data. You will use this information to highlight the ocean
areas in color using the Classification layer.
1 From the View menu, select Traverse….
New Map Composition and Traverse dialog boxes appear.
2 On the New Map Composition dialog, be sure the Vector File option is selected,
then click OK.
An ER Mapper warning dialog and the annotation Tools palette dialog appear. You will use the
vector annotation tools to draw traverse lines on the image.
3 Click Close on the ER Mapper warning dialog to close it. (When using annotation
tools for other purposes the default Fixed Page mode is not recommended, but it is fine
for this exercise.)
4 On the Tools dialog, click the Annotation: Poly Line button.

5 As shown in the following diagram, define a traverse line starting from the dark ocean area at the bottom and extending through to the land areas beyond. (Click once at the  start point, click once at the end point, then double-click to end the line definition.)

6 On the ER Mapper Traverse dialog, click the Bands: button.
7 On the Traverse Band Selection dialog, press the Ctrl key on your keyboard, then
click on 5:1.65_um in the list to select it.
8 Click OK on the Traverse Band Selection dialog.
A single profile for band 5 appears. Notice that the value in band 5 dips to less than 20 in all areas
of ocean, and jumps up to greater than 20 in land areas. TM band 5 records middle infrared
reflectance, which is typically very low in water areas due to strong absorption of infrared light.
You will use this value of 20 as the threshold in your formula to highlight ocean areas.
Tip: You could also use the Cell Values Profile feature under the View menu to
determine this threshold.
9 Click Close on the ER Mapper Traverse dialog to close it, then click Close on the
Tools dialog to close it also.
10 When asked to save the current annotation, click No.

Define a formula to mask water from land
1 Turn on the Classification layer by right-clicking on it and selecting Turn On.
2 With the Classification layer selected, click the Edit Formula button in the
process stream to open the Formula dialog box.
3 In the Generic formula window, edit the formula text to read:
if input1 < 20 then 1 else null
This formula tells ER Mapper “if the image data values in the selected band are less than 20, then
set the value to 1, else set it to null.” Any pixels with a value less than 20 are considered water, and
20 or greater are considered land.
4 Click the Apply changes button to validate the formula.
5 In the Relations window, select B5:1.65_um from the INPUT1 drop-down list.
The threshold formula now references band 5 of the Landsat image.
6 Click Close on the Formula Editor dialog to close it.
Choose an overlay color and name and display the image
1 In the process diagram, click the Edit Layer Color button.
2 Choose a blue color, then click OK to close the Color Chooser dialog.
3 In the Classification layer’s text description field (on its left side), type the description
text water areas and press Enter or Return.
The areas of ocean in the image are highlighted in a blue mask (areas where band 5 values meet
the criteria of being less than 20). Other areas that do not meet that criteria are assigned the value
null by the formula, so the color composite image created by the RGB layers “shows through” the
blue mask in those areas.

Note: You may add additional Classification layers to display overlays in other colors
meeting other criteria. Classification layers on top of the layer list take display
priority over others below them. For example, if two Classification layers would
cover overlapping areas, the color of the layer on top covers the color in the layer
below it where the two overlap. The color of the lower layer is only visible where
there is no overlap. (Classification layers always cover other raster layer types,
regardless of their position among the other layer types.)



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s