Link to USGS home page

U.S.G.S. Planetary GIS Web Server - PIGWAD

Planetary Interactive G.I.S.-on-the-Web Analyzable Database

GridPig Extension

This extension performs a variety of tasks that include correcting the grid to image routines, help with clipping, mosaic, set to null, statistics, and grid volumes.  The lateset version is available to download from here.

I would like to thank the many ArcView coders out there which many of these routines were written by. When found, I have tried to squash any bugs.

Download/Install:  Download the .zip file and unzip it. Copy or move the GridPig.avx and britecon.avx files to your ArcView's EXT32 directory. For Window's users copy or move the g2i.dll file to ArcView's bin32 directory. In ArcView, open the Extensions menu and activate the Grid Pig extension. This will add the Brightness and Contrast Editor button, the Move Theme button, and the Grid Pig menu options to the View interface and the Continuous Color Legend tool in the Layout interface. Note: Many Grid Pig tools will not activate until you add a grid to your view. 

To use the Grid PIG tools, add a grid to your view.

PigGrid menu display
  • Functions that the Grid PIG menu display are:
    • Smooth Color Ramp (supports vector and raster legends)
    • Clip Grid with Graphic
    • Extract Grid from a Graphic
    • Clip Grid with Polygon
    • Grid Resample
    • Grid Statistics
    • Grid Truncate
    • Set Grid Value(s) to NULL
    • Grid Shift
    • Grid Rotate
    • Grid Unsigned to Signed
    • Grid Cut/Fill Value
    • Mosaic Grids
    • Merge Grids
    • Convert Grid to Image (4 options: legend colors, with hillshade, single 8 bit, or 3 grids to an RGB image). Now supports floating point grids to RGB.
    • Batch Raster to Vector Point
    • Grid Value to a Point (add X,Y and Grid value to a point theme)
    • Grid Values to a Point (add X,Y and Grid value to the start and end points of a line theme)

 

  • Smooth Color Ramp:   This function allows you to smooth the color scale.  It will give more intervals of color for the grid values.
  • Clipping Routines:
    • Clip with a Graphic: This function allows you to clip a portion of the grid by using a graphic such as a polygon or rectangle.  The new clip will be added to the view window.  This figure shows the portion of the grid that was clipped by using a rectangular graphic.
      clipped graphic image
    • Extract Grid with Graphic:  This function is similar to Clip with a Graphic, however, the area not clipped will be set to null.  The new clip will be added to the view window. Make sure to refresh your Analysis properties after this function is run.
      extracted graphic image
    • Clip Grid with Polygon:  In order to operate this function, a polygon theme must be in the view window.  This function will clip the extent of the polygon graphic and add it to the view.
      clipped with polygon image
  • Grid Routines
    • Grid Resample: Resampling is the process of determining new values for cells in an output raster that result from applying a geometric transformation to an input raster dataset.  There are three choices for resampling (1) nearest neighbor, (2) bilinear interpolation, (3) cubic convolution.  Nearest neighbor determines the location of the closest cell center on the input raster and assigns the value of that cell to the cell on the output raster.  Bilinear interpolation calculates the value for an output pixel from the values of the four nearest pixels in the input image based on the weighted distance to these pixels.  Cubic convolution is similar to bilinear interpolation except the weighted average is calculated from the 16 nearest input cell centers and their values.  The image below was resampled with an output cell size of 30 and the bilinear interpolation method.
      before resampling image
      Before resampling


      afterresampling image
      After resampling

    • Grid Statistics:  Gives you the statistics of your grid.
      grid statistics image
    • Grid Truncate:  This function takes the values of the grid output and truncates to whole number (floating point to integer).
    • Set Grid Value(s) to NULL:  Allows you to select grid value(s) and set them to null.  The value choices are:  single value, less than or equal to, and greater than or equal to.  The image below was choosing less than or equal to 2050.
      Grid values set to null image
    • Grid Shift:  Will shift the X and Y coordinates of the raster dataset by a specified offset.  
    • Grid Rotate:  Rotates the raster dataset by a specified amount.  The image below was rotated 60 degrees and resampled by the nearest neighbor method.
      rotated grid image
    • Grid Unsigned to Signed: ArcView 3D Analyst or Spatial Analyst does not recognize signed 16 bit files (images with negative values). Thus when an image is converted to a grid the negative values become large positive values. This tool will convert the values back to the correct negative value.
    • Grid Cut/Fill Value: Subtracts two grids representing a top surface and a bottom surface to calculate volume. Very slow.
  • Grid Mosaics:  Combine several spatially adjacent raster datasets into a single, larger dataset.
    • Mosaic Grids:  Smoothes the transition between the adjacent raster datasets in the overlapping areas. 
    • Merge Grids:  The cell is assigned to the last input value from the series of input raster datasets.
  • Grid Conversions:
    • Convert Grid to Image:  Converts the grid to an image file with options (legend colors, legend colors with hillshade, single 8 bit, or 3 grids to an RGB image). Now supports floating point to RGB. Output formats include TIF, JPG, BSQ, BIL, BIP. 
    • Batch Raster to Vector Point:  Converts each cell of the input raster to a point in the output dataset.  Each point will be position at the center of the the cell that it represents.
  • GRID Values to Themes:
    • Grid Value to a Point: add X,Y and Grid value to a point theme (added exact intersection or 4 point interpolation method).
    • Grid Values to a Line: add X,Y and Grid value to the start and end points of a line theme (added exact intersection or 4 point interpolation method).
U.S. Department of the Interior | U.S. Geological Survey | Astrogeology Research Program
HOME | Search | Disclaimers & Privacy
Send Comments to: thare@usgs.gov
URL:
Last modified: