Difference between revisions of "Tarsier tutorial: Raster resampler"

From CCoWS Wiki
Jump to: navigation, search
(Who has taken this tutorial?)
(Who has taken this tutorial?)
 
(6 intermediate revisions by 5 users not shown)
Line 24: Line 24:
  
 
* [[Tarsier tutorial: Raster data]]
 
* [[Tarsier tutorial: Raster data]]
 +
* Have data in TRA format with latlon projection
 +
** If using kauai.asc from [[Tarsier tutorial: Raster data#Obtaining raster data|Tarsier tutorial: Raster data]]
 +
*** Open it in a Raster View.
 +
*** Select Raster --> Properties...
 +
*** Enter "latlon" for Projection.
 +
*** Click OK.
 +
*** Recall that [[Tarsier: Saving files|saving files]] in Tarsier is a bit idiosyncratic.
 +
*** Select the Raster View window.
 +
*** Select File --> Save As
 +
*** Save the RasterData with a TRA extension for use in this tutorial.
 +
*** You do not need to save the Mask or the Raster View files.
  
 
== How do you re-sample a raster in [[Tarsier]]? ==
 
== How do you re-sample a raster in [[Tarsier]]? ==
Line 59: Line 70:
 
== Who has taken this tutorial? ==
 
== Who has taken this tutorial? ==
  
Please enter your user name here:
+
Please enter your user name at the bottom of this list, and the date:
  
 +
* Nick M
 +
* ryanf
 
* jonathan
 
* jonathan
*...
+
* jessicari
 +
* Alberto Guzman
 +
* Brian
  
 
== Next ==
 
== Next ==

Latest revision as of 08:21, 8 April 2010

What is raster re-sampling?

Raster data are gridded data, where the grid usually represents geographic space, and the values in the grid usually represent geographic properties at locations specified by the grid.

Raster grids can be specified with different locations, different cell sizes (different resolutions), and different geographic projections (e.g. Geographic (lat/lon), UTM, GIH, State plane, etc.).

To convert raster data from one grid to another, re-sampling is required. This involves, estimating a value for each cell in the new grid based on one or more nearby values from the old grid. It always involves a change in the accuracy (usually a reduction in accuracy) with which the raster data represents the actual property of interest, because of the inherent changes in resolution, or blurring of information across cell boundaries. So, re-sampling should be done as infrequently as possible.

Re-sampling methods

There are many ways of estimating values in the new grid cell. No method is inherently better, and the method you choose will depend on the type of data you have and the output that is acceptable for you purposes.

Methods include:

  • Nearest neighbor - this takes the value of the nearest input cell
  • Simple averaging - takes the arithmetic mean of all input cells within the new output cell
  • Bilinear - computes a distance weighted average of the four nearest input cells
  • Cubic convoluted - fits a curve to the nearest 16 input cells
  • Splines - output values are computed from a spline fit to the input raster
  • Majority - output value is determined from the most common value of the input cells within the new output cell

Currently the Raster Resampler offers support for nearest neighbor and bilinear for the upsizing procedure (resampling to a finer resolution grid) and simple averaging for downsizing (resampling to a courser resolution grid).

Pre-requisites for this tutorial?

  • Tarsier tutorial: Raster data
  • Have data in TRA format with latlon projection
    • If using kauai.asc from Tarsier tutorial: Raster data
      • Open it in a Raster View.
      • Select Raster --> Properties...
      • Enter "latlon" for Projection.
      • Click OK.
      • Recall that saving files in Tarsier is a bit idiosyncratic.
      • Select the Raster View window.
      • Select File --> Save As
      • Save the RasterData with a TRA extension for use in this tutorial.
      • You do not need to save the Mask or the Raster View files.

How do you re-sample a raster in Tarsier?

  1. Open Tarsier
  2. Select File --> New --> Tools --> Raster re-sampler (if its not on the list, you need to load a DLL)
  3. You should see a RasterResample window with some options and a number of UseeControls.
  4. The basic process in re-sampling is to convert the values in input raster to values in an output raster using the template raster to specify the spatial grid to be used in the output raster.
  5. First, you should specify an input raster. Use its UseeControl to select an already-loaded raster (drop-down arrow) or open one from file ('Open').
  6. Next, you should decide if you have and want to use a template raster. If you don't, one will be automatically created for you.
    1. If you want to use a template raster, specify it using the Template raster UseeControl
  7. Now, you're ready to execute the re-sampling.
    1. If you're using a template raster, click the button at top-left with an icon that looks like cogs.
    2. If you're letting a template be created for you, click the button that says 'Auto-create...'
  8. Finally, you can view you raster. Click View on the output raster's UseeControl
    1. To change how it looks, see the tutorial for raster data

Saving your work

  1. We're not quite done, you'll want to save not only your new raster, but also the re-sampler, so that you can document how you made your raster and so you can do it again if you need to.
    1. Recall that saving files in Tarsier is a bit idiosyncratic.
    2. Select the re-sampler window
    3. Select Save As from the menu
      1. A number of dialog boxes will appear one by one, each one asking you if you want to save one of the many files that the re-sampler uses, or the re-sampler file itself (.trp).
      2. The first dialog pertains to the input raster. Its probably already saved, so just type ESC to quit saving it again.
      3. The files you do want to save are probably just the output raster (.tra) and the re-sampler file (.trp) which lists all the files and options used in the re-sampling.
      4. When saving the output raster, give it a name that records that it was resampled, for example:
        1. If your input raster was called: kauai_GrownNoData_NegativesFixed.tra
        2. You could call name your output raster: kauai_GrownNoData_NegativesFixed_ResampAutoUTM.tra
        3. This sounds ridiculously long, but it works well and is very strongly recommended.
      5. Hit ESC on any files you do not want to save.
  2. If you ever want to re-do or modify this re-sampling, just open the .trp file.
  3. Also, if you change anything, and you want to make sure its saved before you move on, you can always select File --> Save -- Save All Named (which covers everything except what's contained in default objects that Tarsier created for you but that you have not yet named (by saving), such as 'Raster Data 1').

Who has taken this tutorial?

Please enter your user name at the bottom of this list, and the date:

  • Nick M
  • ryanf
  • jonathan
  • jessicari
  • Alberto Guzman
  • Brian

Next

Links