Monday, January 24, 2011

ArcGIS Bug: Certain img files yield incorrect cell count totals

A coworker and I just ran into a problem with the reported cell counts of an img file. We were performing a mosaic using an img and a grid and we were checking the cell counts of the final raster and they seemed much too low. Come to find out, the totals for the img appear to be wrong.

We used the copy raster tool to copy to a grid. The cell count totals for the new grid are much lower than the original img. We copied the grid back to an img. The new img has the same cell count totals as the grid.

We hypothesize that there is some corrupted state an img can exist in, such that ArcGIS cannot properly count the cell totals, but it can still properly convert to different raster types.

Example File:  (download "Landcover zip file")

ArcGIS Versions:
9.3, 10.0


Thursday, January 13, 2011

ArcGIS: Define Projection vs Project

In ArcCatalog, there are three projection related tools in ArcToolbox. These tools caused me confusion in the beginning, and they seem to cause others confusion as well.

Define Projection - This tool does not change a projection. It changes the metadata describing the current projection of the dataset. You should only use this tool if the projection is currently described as unknown or is known to be incorrect. With this tool you are defining or describing the dataset by saying "Hey, those points are in this projection."

Project - This tool operates on features to change the current projection from one defined projection to another. For example, if you have a point dataset in a UTM projection, each point has a pair of numbers describing that point. When you use this tool to change its projection, each number is recalculated to reflect its equivalent value in the new projection.

Project Raster - This tool operates on rasters to change the current projection from one defined projection to another.

Also, if you have a dataset and the projection is currently described as unknown, and despite all your Google searches, emails and phone calls, you can't determine what it is supposed to be, and you can't find an equivalent dataset with the projection properly defined, you can use the following method as an act of desperation to define it. Please, make sure you record in the metadata that the projection was "guessed at" so future users will know that there is uncertainty about whether the defined projection matches the projection that the coordinates belong to.

1. Create a new document in ArcMap.

2. Add a reference dataset with a defined projection (it cannot be defined as unknown, or be potentially incorrect)

3. Add your dataset with the unknown projection (make sure it is defined as unknown)

4. Right click on the map and select data frame properties

5. In the data frame properties dialog, select the Coordinate System tab

6. Remember, this is detective work. Go back and look at the point values themselves if needed. Do the coordinate values look like they are in meters or degrees? What is the state plane projection for this location?

7. Select a coordinate system that is your best guess for what the projection might be, click ok to exit the dialog

8. As you change the projection for the data frame, the reference dataset will continue to be in the correct location on the map by reprojecting on the fly (coordinates are recalculated in memory for the map, but the dataset on disk remains unchanged).

9. The dataset with the unknown projection will start hopping all over the place. No on the fly projection is happening for this dataset. It is placed on the map using its unaltered coordinate values.

10. After repeating this process, and your unknown dataset aligns perfectly with your reference dataset, you have LIKELY found the correct projection. I emphasize likely, because there is still uncertainty, and you should note this uncertainty in the metadata.

Monday, January 10, 2011

ArcGIS 10: Script Error After Clicking on Description Tab

Here is a weird ArcGIS 10 bug for you.

A blank tool window and a blank script error window, but only after clicking on the Description tab in ArcCatalog. 

(Someone reported that this error also occurs when you edit the item description (add metadata) for a model or script and appears to also be fixed the same way)

In internet options, accessible through internet explorer or the control panel, go under the Security tab and set the level to Medium. There are no more script errors. To experiment, I went back and set it to Medium-High, the script errors returned, back to Medium they're gone! 

  1. ArcGIS Resource Center: ArcCatalog v10 Internet Explorer Script Error on page, Run ActiveX control