ArcGIS ModelBuilder tutorial

I have written a short ModelBuilder tutorial that shown how to use an iterator to automate a repetitive process – converting a number of polygon feature classes to rasters in a geodatabase.

If you are interested in learning more about what can be done with the ModelBuilder, explore the ArcGIS Help files (search for ModelBuilder) and work through the two tutorials, or request a code to take the ModelBuilder course from the Virtual Campus.

Introduction to GIS course – first module

I am working on developing a series of self-paced GIS training modules. This first effort is designed for users who have never used ArcGIS before, and is a very simple introduction to using ArcMap.

The data are available to download here.

There is also a link to the data download in the exercise.

More updates and material to follow… You will need access to ArcMap 10.1 and have an Internet connection to complete this module.

ArcGIS for Desktop – “Tool not licensed” error

If you receive a ‘tool not licensed’ error when trying to use an ArcToolbox tool from an extension (Spatial Analyst, 3D Analyst, or others) then it’s likely you have not enabled the extension before trying to use it. If the extension has a toolbar, making it visible is not the same as enabling the extension.

Note that the error message states no… “license currently available or enabled“. The default install of ArcGIS includes all extensions, so it’s likely not enabled if you’re seeing this message.

To remedy this, open the Customize menu and choose Extensions…

Check the box for any extension you wish to use, and click Close. Try re-running the tool and it should work. To verify if a license is available, open the ArcGIS Administrator and select the Availability panel. Extension licenses will be listed below ArcGIS…

How to update an ArcGIS student edition license

If you are running your own copy of ArcGIS – the Student Edition – the license is valid for one year. It is possible to renew your student license without re-installing ArcGIS or obtaining another install DVD. You will first need to get a new registration code. These are available by sending an email to it-help or to mdhyslop at mtu.edu

Detailed instructions for activating your license are available as a PDF: How to update an ArcGIS Student Edition license.

Please email mdhyslop with questions or comments.

How to determine the number of streams entering and exiting lakes using NHD data

Obtain data

Download a pre-staged file geodatabase for HUC subregion(s) of interest from http://nhd.usgs.gov/data.html and extract the contents of the download.

Prepare data

In ArcGIS, add the feature classes NHDWaterbodyNHDFlowline, and WBD\HU8 to your map. If you wish to work with lakes and ponds only, either perform a definition query on NHDWaterbodyto show only Type = Lake/pond (“FType” = 390) or select all FType = 390 and write the records out to a new feature class.

Remove the feature type “artificial path” from the feature class NHDFlowline. Artificial paths are created by NHD staff to simulate connections between inflows and outflows from water bodies (rivers entering and leaving lakes). Leaving these features in the data set will result in duplicate entries and an artificially (2x) high number of inflows and outflows. To remove these features from your analysis, you may either select all elements not flagged as ArtificialPath and write out to a new feature class, or perform a definition query to exclude them (“FType” <> 558).

You can create a new file geodatabase to hold your exported files and the results of your analysis or write the new data to the pre-staged geodatabase you downloaded above. Either option is fine.

Perform analysis

Intersect rivers and lakes

Open the Intersect (Analysis) tool and add your two layers (NDHFlowline and NHDWaterbody) as prepared above as Input Features. Change the Output Type (optional) from INPUT to POINT. This tool will create points wherever NHDFlowline features (rivers and streams) enter or exit lakes and ponds. Save your output file with a name that makes sense (e.g., include the HUC ID and InflowOutflow: NHD_403_InflowOutflow).

Add waterbody ID information to your point file

To obtain counts for each lake (total inflows and outflows) each lake will need a unique name. Unfortunately, many NHD lakes are unnamed and lake names are not unique (Examples? search for “Wolf Lake”, “Mud Lake”, or “Deer Lake” in any lakes database). Because of these ‘features’ of the data, generating a unique name isn’t as simple as it might be. A workable suggestion: add a new field to the lakes (NHDWaterbody) attribute table named UniqueName, type of Text and length of 50 characters. Ensure you have no records selected, and use the field calculator to populate the UniqueName field with the expression [GNIS_NAME] & “_’NHD’_” & [OBJECTID]  Replace ‘NHD‘ with the three-digit HUC prefix of the watershed you are working in (Lake Michigan is 403). The output will consist of something like “Wescott Lake_403_7″ for records with a lake name, and “_403_17″ for records where the lake was unnamed.

Next, perform a spatial join on your InflowOutflow points layer (created in the intersect step above). Right-click on this layer, and choose Joins and Relates > Join. Set the join type to “Join data from another layer based on spatial location” and choose your lakes layer (NHDWaterbody with the UniqueName field added) as the layer to join to your points. Under 2. in the Join Datawindow, set the relationship to is closest to it. (leaving the relationship set to the default it falls inside will result in no results (the points are not in the lakes, but on their borders). Name your output layer as something that makes sense (InflowOutflow_Lake_names) and save it in your file geodatabase.

Summarize results

Open the attribute table of your output file (InflowOutflow_Lake_Names). Find the UniqueName field and sort it (either ascending or descending) and look a the results. You should find multiple instances of many records (lakes with more than one inlet or outlet). All Distance values should be 0.

Right-click on the field UniqueName and choose Summarize. Choose the output destination (your file geodatabase unzipped or created above) and click OK. Answer Yes when prompted to add the summary table to the map. The resulting table will have one record for each lake (as found in UniqueName) and a Count_UniqueName value that summarizes the number of records of each UniqueName in your InflowOutflow_Lake_Names database. This Count value shows the number of streams entering or leaving each lake.

(Optional) Label lakes with Inflow / Outflow counts

As a last step you can join the summary table (created in the last step) to your lakes layer (NHDWaterbody) to label each lake with its total inflows and outflows. This join should be on the common field UniqueName. Be sure to Join attributes from a table, not Join data from another layer based on spatial location.

DNRGPS tutorial – GIS data in Michigan GeoRef to GPS

1) Launch ArcMap and add your data in Michigan GeoRef coordinates to your map.

2) Make ArcToolbox visible and expand Data Management Tools > Projections and Transformations > Feature > and double-click the Project tool to open it. You can also open the Search window (Windows > Search or Ctrl-F) and search for the Project (Data Management) tool.

3) Select the layer you want on your GPS as the Input Dataset and verify that the Input Coordinate System is NAD_1983_Michigan_GeoRef_Meters. Choose the location and name of your output file (maybe adding WGS84 to the end of the file name). Be sure you are saving a shapefile and not a geodatabase feature class. Click the Spatial Reference Properties icon to select the Output Coordinate System. Expand Geographic Coordinate Systems, then World, and select WGS 1984.
Tip: If you right-click on this (or any) projection definition and choose “Add to Favorites” it will be easier to find in the future.

4) Click OK to run the tool. Your re-projected layer will be added to your map after the tool has finished. You can verify your new layer’s projection by opening its properties and examining the Source tab. If all went well, the Projected Coordinate System should read GCS_WGS_1984.

5) Launch DNRGPS. Choose File > Load From > File… and navigate to the shapefile you just saved. Select it and click Open. Verify that the values in Latitude and y_proj are the same, that Longitude and x_proj are the same, and Projection: No Projection is shown at the bottom of the window. If the values are different or a projection name is shown, something was not set properly in a earlier step and DNR GPS is converting projected to unprojected coordinates, perhaps incorrectly…

6) Connect your GPS and turn it on. You should see a message near the top of the window that your GPS now connected. If you don’t, verify the GPS is on, check your cable, and select GPS > Connect to Default GPS. If that fails, try GPS > Find GPS.

7) To transfer your GPS data, select Waypoint > Upload. Your points should appear in the DNR GPS window. (if you loaded a line shapefile into DNR GPS, choose Track > Upload). You should see a status message after the upload is complete.

DNR GPS tutorial – GPS data to Michigan Georef in ArcGIS

1) Launch DNR GPS and ensure the projection is set to None (File > Set Projection and click the Set Projection to NONE button:

 

 

2) Connect your GPS and turn it on. You should see a message near the top of the window that your GPS now connected. If you don’t, verify the GPS is on, check your cable, and select GPS > Connect to Default GPS. If that fails, try GPS > Find GPS.

3) To transfer your GPS data, select Waypoint > Download. Your points should appear in the DNR GPS window.

4) To save your GPS data, choose File > Save To > File… and Save as type… text file (comma delimited) (*.txt). Consider this file your ‘backup’ that can be easily opened by DNR GPS without issue. Next, choose File > Save To > File… and Save as type: ESRI Shapefile (*.shp). This file can be manipulated in your GIS software.

5) Launch ArcMap and add the shapefile you just saved in step 4 to your map.

6) Make ArcToolbox visible and expand Data Management Tools > Projections and Transformations > Feature > and double-click the Project tool to open it. You can also open the Search window (Windows > Search or Ctrl-F) and search for the Project (Data Management) tool.

7) Add your shapefile as the Input Dataset and verify that the Input Coordinate System is GCS_WGS_1984. Choose the location and name of your output file (maybe adding MGRF to the end of the file name). Click the Spatial Reference Properties icon to select the Output Coordinate System. Expand Projected Coordinate Systems, then State Systems, and select NAD 1983 Michigan GeoRef (Meters).

Tip: If you right-click on this (or any) projection definition and choose “Add to Favorites” it will be easier to find in the future.

8) Click OK to run the tool. Your re-projected layer will be added to your map after the tool has finished. You can verify its projection by opening the layer’s properties and examining the Source tab. If all went well, the Projected Coordinate System should read NAD_1983_Michigan_GeoRef_Meters.