|Version 1 (modified by jjr8, 13 months ago)|
Modeling species habitat with environmental predictor variables (original demonstration using MGET 0.7)
- ArcGIS 9.2, 9.3, 9.3.1
- ArcGIS Spatial Analyst extension
- Python 2.4 (if ArcGIS 9.2) or 2.5 (if ArcGIS 9.3 or 9.3.1)
- Python pywin32 package (a.k.a. Python for Windows Extensions) installed for your version of Python
- MGET 0.7 for your version of Python
- Later versions are not likely to work
- R 2.7.0 - 2.9.1
- Later versions will definitely not work; earlier versions might work
Running the demo
- Download the file HabModExample2.zip (274 MB) and save it to C:\ directory.
- Extract the file above to the directory C:\HabModExample2. If you have WinZip, you can accomplish this from Windows Explorer or My Computer by navigating to the C:\ directory, right clicking on the HabModExample2.zip file, selecting WinZip and then Extract to here. If you don't have WinZip, just open the file with Windows and follow the instructions. You might have to change some options to get it to extract to C:\HabModExample2. When you are done, your directory structure should look like this from ArcCatalog:
- Unzip C:\HabModExample2\seamap5.zip into the directory that contains it. Now, the directory structure should look like this from ArcCatalog (you may have to refresh the window):
- You are now ready to run the geoprocessing models. In ArcCatalog, open the toolbox that is labelled for your version of ArcGIS and Python. You'll see five models. Right-click on the first one and select Edit. When the model diagram comes up, open the Model menu and select Run entire model. This first model will convert the oceanography data files contained in the C:\HabModExample2\OceanographyFiles directory to ArcGIS binary grids in the C:\HabModExample2\OceanographyRasters directory. This will take 30 to 60 minutes, depending on the speed of your computer.
- After the first model completes, run each of the remaining models in sequence using the same method. Right-click, select Edit, open the Model menu and select Run entire model. These will run much faster than the first one.
- On ArcGIS 9.3, the Step 2: Create absence points model may initially show a red X, suggesting that it won't work. It will. The red X occurs because the model was built with ArcGIS 9.2, and 9.3 thinks there is a problem with the model. There isn't. Just run it like the others.
- On 64-bit Windows, all of the models in the toolbox may appear with red Xs, like this:
The models were created on a 32-bit machine and reference the MGET toolbox that is stored in the C:\Program Files\GeoEco directory. But because MGET is a 32-bit program, when it is installed on a 64-bit machine Windows forces the toolbox to be stored in C:\Program Files (x86)\GeoEco, breaking the links from the model to the toolbox. To work around this, shutdown all ArcGIS programs and replace the file C:\HabModExample2\Toolbox.tbx with this 64-bit version. The only difference from the 32-bit one is that the models reference tools in the C:\Program Files (x86)\GeoEco directory.
- If you unzipped the example to some other directory than C:\HabModExample2, the Step 3: Sample oceanography rasters at points model will fail when it reaches the Sample Rasters Listed in Fields tool. The problem is that this model assumes the example is stored in C:\HabModExample2 and the sampling fails when it cannot find the directory. To fix this, you must change the model to use your directory:
- In the toolbox, right click on Step 3: Sample oceanography rasters at points and select Edit.
- Double-click the first Calculate Field tool.
- In the Expression parameter, change the path in the first component of the expression from C:\HabModExample2 to your directory. For example, if you stored the example in D:\My_Stuff\GIS\HabModExample2, then change the first component of the string from "C:\HabModExample2\OceanographyRasters\Chl\8Day\chl" to "D:\My_Stuff\GIS\HabModExample2\OceanographyRasters\Chl\8Day\chl". Note: if you do use your own directory, we highly recommend it not contain any spaces.
- Repeat the procedure above for the other two Calculate Field tools.
- Now you can run the model.
- The ArcGIS models in the downloadable demo differ somewhat from those in the video recording. As we enhance the tools, we update the downloadable demo to be compatible with the latest enhancements. For example, in the Step 4: Create exploratory plots model, the video recording shows how to add and calculate fields called LogBathymetry and LogChlorophyll. The downloadable demo contains a much simpler model, made possible by enhancements to the Scatterplot Matrix and Density Histogram tools. These tools now allow you to specify transform expressions, so you don't have to calculate the transforms yourself in separate fields.
- If you have R 2.9.x and you experience a failure from the Predict GAM From Rasters tool in the Step 5: Fit and Evaluate a GAM, and predict habitat model that says GDAL Error 3: Attempt to read past EOF, please see ticket #375 for a discussion of and solution to this problem.
If you have any questions, please email firstname.lastname@example.org.