Using WUImap on Windows 7 and ArcGIS Desktop 10.2

The other day I was asked for help with installing and running WUImap, a GIS tool for calculating and mapping rural-urban interfaces.

The WUImap tool was developed in 2010 by Corinne Lampin-Maillet et al. for a wildfire management project. The tool (v 1.03) works fine on Windows XP and ArcGIS 9.3, but when we tried to run it on Windows 7 and Windows 8 with ArcGIS 10.2 it would not start, and when we got it to start, it would fail to calculate.

The WUImap tool is basically a single Python script, so debugging was possible and we found the issues were due to (a) some hardcoded Windows XP paths that we not valid anymore on Windows 7/8 and (b) some expressions written for VB, whilst ArcGIS 10.2 prefers expression to be written in Python. All of these issue we can fix.

The WUImap tool is licensed under Creative Commons Attribution-NonCommercial-NoDerivs 2.0 France, which does not allow me to post a modified version here, but it does allow me to describe the steps necessary to make it work on Windows 7/8 and ArcGIS 10.2:

  1. Download the WUImap tool from http://fireintuition.efi.int/products/wuimap/download-5.fire and install it. In the final step tick the option to create a desktop icon.
  2. Locate the installed files – these should be in C:\Program Files (x86)\WUImap. The main file is ‘ProgramWUI_english_v1_03.py’, this is the file we will need to modify.
  3. First create a backup copy of the file: right-click the file ‘ProgramWUI_english_v1_03.py’ > Copy, then paste it into the same folder. If asked for administrator permission click Continue. Rename the copy, e.g. to ‘ProgramWUI_english_v1_03_backup.py’. Again accept if prompted for permission.
  4. To modify the file we need to change its security settings: right-click the file ‘ProgramWUI_english_v1_03.py’ > Properties. On the Security tab click Edit, highlight ‘Users (PC name\Users)’ and in the lower pane tick Full control. Click OK and OK again.
  5. Open the file ‘ProgramWUI_english_v1_03.py’ in a text editor: right-click the file > Edit with IDLE. (Or use your other favorite text editor.).
  6. Make the following changes:

Line 228 is:

            photo = PhotoImage(file ='C:/Program Files/WUImap/About_english_cc.gif')

replace with:

            photo = PhotoImage(file ='C:/Program Files (x86)/WUImap/About_english_cc.gif')

Line 279-282 is:

            gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
            gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
            gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
            gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")

replace with:

            gp.AddToolbox("C:/Program Files (x86)/ArcGIS/Desktop10.2/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
            gp.AddToolbox("C:/Program Files (x86)/ArcGIS/Desktop10.2/ArcToolbox/Toolboxes/Conversion Tools.tbx")
            gp.AddToolbox("C:/Program Files (x86)/ArcGIS/Desktop10.2/ArcToolbox/Toolboxes/Data Management Tools.tbx")
            gp.AddToolbox("C:/Program Files (x86)/ArcGIS/Desktop10.2/ArcToolbox/Toolboxes/Analysis Tools.tbx")

Line 399 is:

                gp.CalculateField_management(zone_batisOWUI, "Nbatis", "[Join_Count]", "VB", "")

replace with:

                gp.CalculateField_management(zone_batisOWUI, "Nbatis", "!Join_Count!", "PYTHON", "")

Line 474 is:

                    gp.CalculateField_management(batiOWUI_groupe_Buffer_single, "Nbatis", "[Join_Count]", "VB", "")

replace with:

                    gp.CalculateField_management(batiOWUI_groupe_Buffer_single, "Nbatis", "!Join_Count!", "PYTHON", "")

Line 756 is:

                gp.CalculateField_management(zone_batisWUI, "Nbatis", "[Join_Count]", "VB", "")

replace with:

                gp.CalculateField_management(zone_batisWUI, "Nbatis", "!Join_Count!", "PYTHON", "")

Line 830 is:

                    gp.CalculateField_management(batiWUI_groupe_Buffer_single, "Nbatis", "[Join_Count]", "VB", "")

replace with:

                    gp.CalculateField_management(batiWUI_groupe_Buffer_single, "Nbatis", "!Join_Count!", "PYTHON", "")

Save the file.

To test:

  1. Create an output directory, e.g. C:\WUImap_datatest\testoutput
  2. Double-click the WUImap desktop icon.
  3. Specify the test datasets that came with WUImap (they are installed in C:\WUImap_datatest) and the test output directory:WUImapGUIwithtestdata
  4. Click Run.
  5. In the background there now is a window where you can check progress:WUImapProgress
  6. When WUImap is finished, the main Window ‘Run’ button changes to ‘Program Terminated’.
  7. It should now have created two rasters, ‘wiu_types.tif’ and ‘housing_configuration.tif’, which you can load into ArcMap:WUImapOutputWuiTypes
Advertisements

One thought on “Using WUImap on Windows 7 and ArcGIS Desktop 10.2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s