ArcGIS Tips Macro Always ask, Is the data/graphic presentation valid on substantive grounds? Is it biased in some way or another? If so, why? Think critically about the substantive validity of data attributes (e.g., race/ethnic categories) and spatial units (e.g., census districts) in maps. Remember that GIS is just one approach to representing space, place, and society, with its particular set of strengths and limitations. General Don t use uppercase letters or spaces in directories or filenames. To avoid disrupted layer paths (meaning that ArcMap cannot located layers), set map properties to store relative path names: File/Map Properties/Data Source Options, click store relative path names (see next entry on disrupted paths ). Why is there a red exclamation point next to one of the data layers? Because the paths among the data set s files have been disrupted so that ArcMap cannot locate the indicated layers. o Note: An ArcMap project file (.mxd) makes a set of data paths to integrate data files into a project. Creating a layer attaches paths to a data file. o How to repair a path in ArcMap: right-click the layer/source/set to data source/add. Check that red exclamation point has disappeared. o See Help/Repairing Data Sources in ArcCatalog: right-click on the layer and inspect its source properties; click Set Data Source button and orient the layer s data source to the appropriate shapefile, check that the layer file symbolizes correctly on the map and that it has no broken links icon in the Table of Contents, right-click the layer and Save as Layer File. Saving a map: always use save as to save a map as a new file, rather than save a changed version of a previous map file, because map files are easily corrupted. What if ArcMap s Table of Contents disappears? Click Window/Table of Contents. What if a toolbar (e.g., Spatial Analyst) disappears? Click View/Toolbars/ Spatial Analyst. Click Tools/Customize/specific command tab. Click Save on combobox: dropdown arrow/choose template. Drag command to toolbar. Close In ArcCatalog, how to obtain the Data Conversion Wizards? Click Tools (not ArcToolBox)/View/Toolbar/Customize, then click ArcGIS 8x Tools on the Toolbar tab and click Close. In ArcMap, how to obtain the Buffer Wizard? Click Tools (not ArcToolBox)/Customize/Toolbars/Commands/Buffer Wizard. Then click and drag the Buffer Wizard icon on to a tool bar. o A simple way to create buffers: click Edit tool, click feature to buffer, click Target Layer dropdown arrow & click the layer with the type of feature you want the buffer to be (line or polygon), click the Editor menu and click Buffer, type the distance in map units, and press Enter.
o During an editing session, you can use ArcToolBox/Analysis Tools/Proximity/Buffer but not the Toolbar Buffer Wizard. Why can t I reorder the data files in the table of contents? Make sure the bottom tab is set to Display. How to adjust display of measurement scale or geographic coordinates on status bar? Click Table of Contents/Layer/Properties/General/Units/Display, and specify units. ArcMap won t reflect the features I ve selected: check Selection/Selection Options and check that the options are correctly set. I created a new table. Why isn t it visible in the table of contents? Click the Source tab at the bottom of the table of contents. If a shapefile won t display correctly, check to see that it as a.prj file with the shapefile s name. If not, copy and paste the.prj file and give it the name of the shapefile in question. How to calculate not equal to? E.g.: income <> 0 How to use the wildcard (*) to select attributes? E.g., if Zoning has various commercial categories labeled C-1 to C-5: [Zoning]= C* In Select by Attributes, the Like rootname* option is useful to select related variables: [District] like Residential* Why won t my text (i.e. string) field calculation work? Make sure you ve enclosed the variable in double quotation marks. Why won t my quantitative field calculation work? o Make sure you ve specified the appropriate type (short integer, long integer, float, double). o And make sure there are no zeros in the field being calculated. Eliminate them via Select by Attributes, e.g., [Income] > 0 Why does a layer have no attribute table? Floating point grids don t have attribute tables, so check the field type (Properties/Fields). How to make appropriate calculations on numerically displayed categorical data (e.g., months in numerical form, zipcodes)? Consider such string operator functions in Field Calculator as Left[] or Right[]. Click String to display these. Make appropriate normalizations in mapping count or weight statistics. Do not normalize averages, medians, or percentages. You can display multiple attributes in maps: Properties/ Symbology/Multiple Attributes. Editing: o For tables that don t have associated geographic features, click Editor/Start Editing, then edit the attribute table (using the Undo button to undo an edit). Click Save Edits. o To add features to a coverage, shapefile, or geodatabase, use the Create New Feature task on the Editor toolbar. How to join tables keeping only the matching records (i.e. eliminating null values )? In the Tables Join dialog box, click Advanced options and click preserve matching records only. o Alternatively, eliminate the null values by selecting the appropriate attributes after doing the tables join (but make sure that subsequent operations are performed on selected features only or select from currently selected set if you want to analyze these observations only). o Or create layer from selected features, or, to save the file of selected features, click Data/Export and click to display on map (clicking Source at the bottom of the table of contents to display the new table). Why can t I add a new field to my attribute table?
o You can t do so if you ve clicked Edit/Start Editing (i.e. if you re in an editing session), so to add a new field you have to exit the editing session. o You can t do so if you ve currently selected a subset of attributes or locations. o And you can t do so if the table is currently involved in another ArcMap or ArcCatalog session. Why can t I perform an editing session (via the Editor toolbar) in ArcMap? You may not have shapefiles or feature classes on your map, or you may have read-only data on the map. In ArcCatalog, why can t I delete a feature class from a geodatabase? You can t do so while any part of the geodatabase is in use in ArcMap. How to extract one field from an attribute table? ArcToolBox/ Dissolve (i.e. a spatial summary ) on the particular field. (See also Properties/Fields/Visible box to turn off the display of particular fields without deleting the data.) o Dissolve may not work for newly created fields such as percentages. What if, in normalizing data display in symbology, I then can t turn the normalization off? If the attribute table doesn t contain a None field, the in the attribute table add a new field, call it None, and leave its cells empty. Then, in symbolization, clear Features and then click Quantities and, e.g., Proportional colors. How to add centroids to your map as points? See Help/Making field calculations concerning the procedure, including the VBA statements for X and Y values (which you can copy and paste into the first text box of the Advanced Calculator). o After calculating centroids, open the attribute table and export it as a plain dbf table by clicking Options/Export. o Make the centroids two dimensional via Tools/AddXY Data, specifying that the map projection be the same as that of the original layer. How to combine, e.g., several hazard risk categories of a common scale (such as flood, erosion, and storm surge, each 1-5) into a combined total risk category? o Use ArcToolBox/Analysis Tools/Union flood & erosion=comb1, union comb1 & storm surge=totalrisk. o Save totalrisk by exporting it to geodatabase, importing the symbology from totalrisk into the map layer. o In the attribute table make a new field (long integer) named risk_sum. Calculate risk_sum to be the sum of the risk attributes from each hazard risk category. o Classify risk_sum s scale. o Symbolize the layer with graduated colors. How to combine count data with spatial zones? o Select by location: but doesn t preserve sub-zone data (if relevant to the issue at hand). o A spatial join: preserves sub-zone data. How to find the length of, e.g., roads within a spatial zone? o Select by location: that are contained by the spatial zone (but does not preserve sub-zone data) and click the appropriate column and click Statistics or, to create table, click Summarize (with sum option). o An intersect overlay: preserves sub-zone data. Then click the appropriate column and click Statistics or, to create table, click Summarize (with sum option). o A spatial join.
o In general, confirm the consistency of results obtained from select by location, intersect overlay, and spatial join, and adjust your strategy accordingly. E.g., the layer Evacuation categories does not have a category for Nonevacuation zones. How to create this category? Union Evacuation categories with the map from which it was originally derived (e.g., Miami Dade blkgrp). Using raster data, reclassification can be done via Spatial Analyst/Reclassify (or Spatial Analyst/Raster Calculator). How many data categories to use? Most people can discern no more than 5-7 categories for a layer. How to combine two or more data categories into one? o In the table of contents, right-click the layer for which you want to combine categories and click Properties/ Symbology. If necessary, following the instructions for drawing a layer showing unique values. o Right-click over the values/group Values, and reformat the label/ok. o If necessary, right-click the layer in the table of contents/properties/ungroup Values. Documenting Variables It s crucial that you document the content of each variable and how it was computed. Here s how to do so by adding metadata in ArcCatalog: In ArcCatalog, click the relevant variable in the tree. Click the Metadata button (next to Contents and Preview). Click the edit Metadata button on the metadata editor. Add or edit the documentation, then close the editor. Note that under Symbology there are ways to add descriptions to layers. Spatial Analyst/Raster Calculator When, e.g., converting a GWR-produced coverage to raster, in the conversion dialog box specify that the raster data receive the coordinate system of the relevant map. How to replace areas of one value or value range with another value? Spatial Analyst/Raster Calculator or Spatial Analyst Tools/Conditional: CON([District] < 600),600) How to replace areas of no data with a specified data value? Raster Calculator or Spatial Analyst Tools/Conditional: CON(ISNULL([District]),625) How to assign the mean of a set of values to an area? Raster Calculator or Spatial Analyst Tools/Cell Statistics ( mean being one of several options, the others being median, standard deviation, minimum, maximum, variety): MEAN([Oct],[Nov],[Dec]) How to truncate floating-point values into an integer (for purposes of reclassification)? Map Algebra or Spatial Analyst Tools/Math/Trigonometric: INT([Elevation]) How to slice a value into zones of equal value or equal interval? Command Window: Slice_3d <in_raster> <out_raster> <number_zones> {EQUAL_INTERVAL EQUAL_AREA} {base_output_zone} See Raster Calculator or Spatial Analyst Tools/Math/Logical commands such as EQ, NE, GT, GE, LT, LE, AND, OR, XOR, DIFF, IN{list}, OVER, CAND, COR, CXOR.
How to use Map Algebra to set a mask? Map Algebra or Spatial Analyst Tools/Conditional: SetNull How to append raster data sets? ArcToolBox/Data Management/Merge for discrete data, Data Management/Mosaic for continuous data. See Spatial Analyst Tools/Generalization commands such as Aggregate and Region. See Spatial Analyst/Tools sections for local, neighborhood, and zonal statistics, density calculations, and interpolation. 3D Analyst Even after I imported a base height, my raster layer file won t preview as 3D in ArcCatalog: make sure that Preview is set to 3D, then click on the source raster file and click on the new raster file. In ArcScene, my raster layer file won t display as 3D: make sure that it has a base height, then if it does either click Scene layers/vertical Exaggeration (to synchronize the z-values with the x,y coordinates) and click the Full Extent icon, or else import a coordinate system into Scene layers. What do I do if I ve extruded a layer but it s dimensions are much too large? Try clicking Scene layers/vertical Exaggeration/ Calculate from extent. If a layer s attribute table contains measured elevations, extrude the layer by clicking A constant value or expression to set heights, then click Calculator/Fields, and select the measured elevation. ArcCatalog/Geodatabase Regarding geodatabases: o When importing coverages, import only the polygon feature class of the coverage because a geodatabase does not maintain the other coverage feature classes. o When importing feature classes, to exclude feature attributes go to the dialog box s Field Info, the Visible field, and click false for each excluded attribute.