Mexican Spotted Owl, stretching...

ArcGIS Tools
ArcView 3.x Extensions
GIS Consultation
Unit Converter
Jenness Enterprises
Search

 

Grid and Theme Projector

NAME:  Grid and Theme Projector, v. 2     (Click Name to Download)

Aka: grid_theme_prj.avx 

Last modified: February 9, 2004

TOPICS: projection, grid, theme, spatial analyst, datum

AUTHOR: Jeff Jenness
     Wildlife Biologist, GIS Analyst 
     Jenness Enterprises 
     3020 N. Schevene Blvd. 
     Flagstaff, AZ 86004 USA 
     jeffj@jennessent.com

DESCRIPTION: This extension allows you to project both grids and vector themes using the same projection parameter window. The window is very similar to that used by the Projector! extension except that both the input and output projections are displayed on the same window.

This extension also offers a second, slightly more complicated method to project grids which utilizes the Projection Utility Wizard, and which therefore offers the user a way to change datums.

This extension uses the Grid Warp function to project grids and offers you several options to set the output cell size, the interpolation method and the transformation order. Please review the comments and warnings regarding grid projections.

This extension also provides some of the standard grid transformation functions (i.e. Shift, Rotate, Flip and Mirror).

REQUIRES: Spatial Analyst

This extension also requires that the file "avdlog.dll" be present in the ArcView/BIN32 directory (or $AVBIN/avdlog.dll) and that the Dialog Designer extension be located in your ArcView/ext32 directory, which they usually are if you're running AV 3.1 or better. The Dialog Designer doesn't have to be loaded; it just has to be available. If you are running AV 3.0a, you can download the appropriate files for free from ESRI at:

http://support.esri.com/index.cfm?fa=downloads.patchesServicePacks.viewPatch&PID=25&MetaID=483

Recommended Citation Format:  For those who wish to cite this extension, the author recommends something similar to:

Jenness, J. 2004. Grid and Theme Projector v. 1.1 (grid_theme_prj.avx) extension for ArcView 3.x. Jenness Enterprises. Available at: http://www.jennessent.com/arcview/grid_theme_projector.htm.

Please let me know if you cite this extension in a publication (jeffj@jennessent.com). I will update the citation list to include any publications that I am told about.

UPDATES:  Version 1.1 (January 27, 2004) fixes a bug that occasionally caused themes to be projected based on the wrong measurement units, so that a projected theme might be sized and located incorrectly by a ratio of either 0.3804 or approximately 3.281 (the ratio of meters/feet and feet/meters). Version 1.1 is also modified to support customized projection files (“\arcview\etc\default.prj”).

Version 2 (February 9, 2004) adds the option to project grids using some functions from the Projection Utility Wizard, thereby allowing datum transformations.

General Instructions:

1) Begin by placing the "grid_theme_prj.avx" file into the ArcView extensions directory (../../Av_gis30/Arcview/ext32/).

2) After starting ArcView, load the extension by clicking on File --> Extensions… , scrolling down through the list of available extensions, and then clicking on the checkbox next to the extension called "Grid and Theme Projector."

3) Open a view and add the grid or vector theme you wish to project.

IMPORTANT -- Regarding Grid Transformations:

Projecting grids reduces the accuracy of your data and should only be considered if no other options are available. Because of the nature of grid data, they cannot be projected with the precision that vector themes can. Vector features are composed of a series of well-defined points (vertices or nodes, for example), which are very appropriate for mathematical repositioning. Raster data such as grids do not have this quality, and therefore it is inevitable and unavoidable that your data will be degraded by the transformation. You can see this if you change the projection of a grid dataset and then change it back. Vector features should return exactly to their original state but grids will just go through 2 stages of degraded accuracy, similar to blurring an image.

If you wish to conduct an analysis involving unprojected grid data and projected vector data, and it is important that both datasets be in the same projection, then you would be much wiser to unproject the vector data rather than project the grid data.

There are still good reasons to project grids, however. If your original grid is unprojected and you need your X- and Y-units to be the same as your Z-units (maybe for accurate hillshading or for calculating surface areas [see Grid Surface Areas at http://www.jennessent.com/arcview/surface_areas.htm], then you must project the grid into a projection that uses the same coordinate units as your elevation values (i.e. meters or feet).

Projecting Grids (Option 1):

Begin the process by clicking either the button or the “Grid Projector! --> Grid and Theme Projector…” menu item. You’ll first be prompted to identify the theme to project. Select the correct theme from the list and click ‘OK’.

You’ll now see the Projection Parameters window. The window will be titled “Theme Projector” if you have chosen a vector theme to project, and “Grid Projector” otherwise:

Specify the parameters for the current projection and the new projection. Make sure your projection is appropriate for your region (for example, a projection centered on Venezuela may cause the extension to crash if you use it to project a street network in Rome).

If your view is projected and you are projecting a Grid theme, then the extension will assume that the current projection of your Grid theme is the same as your view projection and pre-set the Current Projection parameters accordingly. Alternatively, if your view is projected and your are projecting a Vector theme, then the extension will assume that your Vector theme is actually unprojected (which it should be if you have set a View projection). Otherwise, you will have to make sure you correctly specify the input projection.

IMPORTANT:  This tool is not intended to convert between different datums! According to all the sources the author could find, there is (surprisingly) no mathematical transformation to change datums. The datum conversion tools available in other projection routines apparently just shift the entire dataset by some pre-set distance depending on the datums and region. If you need to project your grid into a new datum, I recommend you use Grid Projector 2 (see below).

The choices for Interpolation Method and Transformation Order only apply to Grid themes and these boxes will be disabled if you are projecting a Vector theme.

Interpolation Method: Spatial Analyst offers 3 interpolation methods when transforming grids. Because it is very unlikely that the transformed grid will align exactly perfectly with the original grid, each of these methods generates new cell values based on the what value the cell centers of the transformed grid would have if they were projected back into the original grid. I am unaware of whether any of these methods would clearly be preferred over the others when projecting continuous elevation information, although the Bilinear Interpolation method makes intuitive sense.

Nearest Neighbor: If the cell center of the new cell were projected to the original grid, the value of the new cell will equal the value of the intersecting original grid cell. Nearest Neighbor transformations are especially good for transforming categorical grids because the new grid will have the same values as the original.

Bilinear Interpolation: If the cell center of the new cell were projected to the original grid, the value of the new cell will equal a weighted average of the 4 nearest cells. Values are weighted according to their nearness. Bilinear Interpolation is useful for continuous datasets.

Cubic Convolution: If the cell center of the new cell were projected to the original grid, the value of the new cell will equal a weighted average of the 16 nearest cells. Cubic convolution is useful for continuous datasets.

Transformation Order: ArcView uses a polynomial transformation to warp the grid into the new projection. The Transformation Order value reflects the degree of the polynomial. Higher orders can produce more accurate warps, but they take more processing time. The ArcView help files say that 3rd order transformations are usually as high as you need to go but this extension lets you use up to 6th order transformations if you are feeling especially ambitious.

Next, if you are projecting a grid, you will be asked to specify your new cell size. This cell size will be based on the units of the new projection. The extension attempts to figure out an appropriate cell size which will approximate the spatial resolution of your original grid, but you have the option to change it if you wish:

This estimate is based on the width of your original cells, and what the maximum width would be if those cell boundary squares were projected into the new projection. The projected squares would likely be larger on either the north or south end of the grid extent, and this extension uses the larger of these two values as the suggested cell size:

Finally, you will be asked whether you would like to add your projected grid to a view, and which view:

Projecting Grids (Option 2):

Both versions of the grid projector work by warping the grid from one projection to another based on a large array of guide points. Grid Projector #1 generates the array of points internally and projects them according to the parameters you specify in the Projection Parameters window, then uses the projected points to guide the grid warp.  Unfortunately, the Projection Parameters window does not offer any means to transform your grid from one datum to another, and therefore may not produce accurate results if such a transformation is necessary. As an example, the author has found that coordinates in Arizona, projected into the UTM Zone 12N projection, are shifted by about 185m and 160° depending on whether you are using the NAD27 or NAD83 datum.

The Projection Utility Wizard (PUW), installed with ArcView 3.2a and 3.3, offers methods to project vector themes and to transform datums. Therefore the PUW is able to both project the array of points and to apply a datum transformation to them, which would in turn allow the grid to be accurately warped from one projection and datum to another.  Unfortunately the PUW does not project grids directly, and the author was unable to figure out how to directly access PUW functions with Avenue, so therefore the user is required to go through a couple of extra steps. Essentially you will need to generate an array of points, project them using the PUW (or any other 3rd-party projection utility you may have available), and then use both sets of points to warp/project your grid.

Grid Projector #2 makes this fairly straightforward. Follow these steps:

  1. Open a new view and add your Grid theme. Do not set a projection for the view.
  2. Use the button to generate an array of points over the extent of your grid. This will create a point theme containing somewhere close to 10,000 points arrayed over your grid. This will be your Input point theme.
  3. Use the PUW (or some other 3rd-party software) to project your Input point theme into a new projection. If the PUW is not currently loaded, load it by clicking the “File” menu, then “Extensions...”, and then selecting “Projection Utility Wizard” from the list of extensions. The PUW can then be run by clicking the “File” menu, then “ArcView Projection Utility...”.
  4. Your new projected point theme will be your Output point theme. Add this theme to your view. It will likely be sitting very far away from your input point theme (and may not be visible at all), but it needs to be in the same view as your grid and your Input point theme.
  5. Use the button to open the “Grid Projector 2 Parameters:” window.
  6. Specify your Grid Theme, Input point theme, Output point theme, Interpolation Method, Transformation Order and desired cell size:

See the discussion above for explanations of Interpolation Method and Transformation Order. If you would like the tool to suggest a cell size, click the “Suggest” button to make a rough guess based on the current grid cell size and the width of the current grid extent and the projected point theme extent. The actual equation used is as follows:

Other Grid Transformation Tools:

This extension also includes 4 basic grid transformation tools that allow you to shift, rotate, or reflect your grid. You can reflect your grid both vertically (“Flip”) or horizontally (“Mirror”). These options are available in the “Grid Projector!” menu, and all options assume that you wish to apply the transformation to a single active Grid theme. These options will only be enabled if you have a single grid theme active in your view.

Shift: This option allows you to move your grid horizontally and vertically. You have the option to move it according to a specified distance and azimuth, a specified X- and Y-distance, or to a specified origin point. Click this option and you’ll be asked to specify your shift parameters:

Pick the option you want, enter the two parameters and click “OK” to generate your new grid:

Rotate: This option allows you to rotate your grid about the origin (i.e. the lower left corner of the grid). Click this option and you’ll be asked to specify your rotation parameters:

The rotation angle reflects the rotation clockwise from the current orientation, and you can enter both positive and negative numbers. Your new grid will not be aligned with your original grid so you must specify an interpolation method (see discussion of Interpolation Method above). Click “OK” to generate your rotated grid:

Flip and Mirror: These options reflect the grid in the X-direction (Mirror) or Y-direction (Flip). No input parameters are required. Click the menu option to generate your new grid:

Enjoy! Please contact the author if you have problems or find bugs.

            Jeff Jenness                                      jeffj@jennessent.com

            Jenness Enterprises                          http://www.jennessent.com

            3020 N. Schevene Blvd.                     (928) 607-4638

            Flagstaff, AZ  86004

                        USA

Please visit Jenness Enterprises ArcView Extensions site for more ArcView Extensions and other software by the author.  We also offer customized ArcView-based GIS consultation services to help you meet your specific data analysis and application development needs.