Corridor Design - Habitat Suitability Model Error

613
8
04-19-2017 02:58 AM
RoshanTailor1
New Contributor

I am trying to perform a HSM1 tool within ArcGIS, and I'm constantly getting the same error message, below.

I have executed this tool several times each time making a small change, and nothing seems to work, I don't know what it means by "The table name is invalid", I have tried naming my output table as 'HSM1_geomean' and 'HSM1_geomean.dbf' and neither have worked. I also don't know what it means by 'missingValues'. And it says at the end, 'succeeded', but I have no corresponding output to add.

I have worked through the associated tutorial data provided, which worked successfully, but cannot get the tool to work for my own data?

Has anyone experienced this issue before, and found a solution to it?

Messages
Executing: HabitatSuitabilityModel "Geometric Mean" G:\Advanced_GIS\Lynx_Model\HSM1_1\HSM1 true landcover G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_lndcvr.txt 65 50_dtm G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_elev.txt 5 topo80_recent G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_topo.txt 10 eudist_roads G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\lynx_dstroad.txt 20 # # 0 # # 0
Start Time: Mon Apr 17 11:38:20 2017
Running script HabitatSuitabilityModel...

CorridorDesigner ----------------------------------------
RUNNING: HabitatSuitabilityModel

 Step 1/4) Checking sum of factor weights
 Step 2/4) Reclassifying habitat factors
            - reclassifying Habitat Factor landcover using the reclass file G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_lndcvr.txt
            - reclassifying Habitat Factor eudist_roads using the reclass file G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\lynx_dstroad.txt
            - reclassifying Habitat Factor topo80_recent using the reclass file G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_topo.txt
            - reclassifying Habitat Factor 50_dtm using the reclass file G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_elev.txt
- PYTHON ERRORS: ---------------
Traceback Info:
  File "G:\Advanced_GIS\CorridorDesignerToolbox_v02\CorridorDesignerToolbox_v0.2\generalScripts\hab_hsmGeneral.py", line 59, in reclassFactors
    gp.ReclassByASCIIFile_sa(factorGrid, factorRemapFile, factorReclass, missingValues)

Error Info:
<class 'pywintypes.com_error'>: (-2147467259, 'Unspecified error', None, None)

- GP ERRORS: -------------------
ERROR 999999: Error executing function.
The table name is invalid.
Failed to execute (ReclassByASCIIFile).


 Step 3/4) Combining habitat factors using Geometric Mean model
- PYTHON ERRORS: ---------------
Traceback Info:
  File "G:\Advanced_GIS\CorridorDesignerToolbox_v02\CorridorDesignerToolbox_v0.2\generalScripts\hab_hsmGeneral.py", line 69, in geometricHsm
    for x in reclassFactorDict.keys():

Error Info:
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'keys'

- GP ERRORS: -------------------
ERROR 999999: Error executing function.
The table name is invalid.
Failed to execute (ReclassByASCIIFile).


 Step 4/4) Deleting intermediate layers
- PYTHON ERRORS: ---------------
Traceback Info:
  File "G:\Advanced_GIS\CorridorDesignerToolbox_v02\CorridorDesignerToolbox_v0.2\generalScripts\hab_hsmGeneral.py", line 101, in delTempFactors
    for x in reclassFactorDict.keys():

Error Info:
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'keys'

- GP ERRORS: -------------------
ERROR 999999: Error executing function.
The table name is invalid.
Failed to execute (ReclassByASCIIFile).


 Finished! 
  
Completed script HabitatSuitabilityModel...
Succeeded at Mon Apr 17 11:38:39 2017 (Elapsed Time: 18.43 seconds)

0 Kudos
8 Replies
DanPatterson_Retired
MVP Esteemed Contributor

without having to check the tutorial, where they using geodatabase tables and other geodatabase inputs?  Do your variable substitutions match for their type and extension (if any, ie dbf vs txt)

0 Kudos
RoshanTailor1
New Contributor

The inputs are for the 'reclass table', which is an ASCII remap file, the tutorial provides and uses txt files, which worked, so I am using the same; I've just modified the txt files to be more specific to my species.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

you need to put an 'r' in front of your paths I suspect, The paths aren't being interpreted properly.  Try an easier location with a \a, \t, \n or \U in the path string.

a = "G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_lndcvr.txt"

print(a)
G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data        utorial\speciesData\Lynx\Lynx_lndcvr.txt

# try... # see the 'r' at the beginning
a = r"G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_lndcvr.txt"

print(a)
G:\Advanced_GIS\CorridorDesignerToolbox_v02\Species_Data\tutorial\speciesData\Lynx\Lynx_lndcvr.txt

# the '\t in \tutorial is being interpreted as a tab

0 Kudos
RoshanTailor1
New Contributor

Ok, so I've changed the path directory to (G:\U_Lynx\lndcvr.txt), but when I try to put 'r' in front, I get a red X saying the dataset does not exist? I tried running it without the 'r', just to see, and I still get the same error message? 

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

U's are no good either (long story) but the r in front should make it Unicode compliant for the future.  And of course you moved all your data to the new folder and revalidated the model with the new data? and they are parameters in your model? if not, then it won't find the data

0 Kudos
RoshanTailor1
New Contributor

So I've changed the directory again to (rG:\a_Lynx\lndcvr.txt), and cannot run the tool, have I placed the 'r' correctly, as seen in the image? 

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

ok.. don't type which is what I think you are doing (the raw format is used for code and the path needs to be enclosed in quotes, which you can't do in a model.

Did you navigate to the files on disk using the folder icon to the right of the status input line?  That is what you have to do if you aren't.  The model dialog will check for the correct folder location and handle the paths.  I had assumed you had move this to a script.  The model dialog will work if you navigate and select the input files.  If it says it can't find something then, then the problem needs to be rectified by other means.  Either the file is of the wrong type (*.txt doesn't mean anything) or the content is incorrect..  If that model works with the 'tutorial data', then it should work with other data, if the files are of the same type and content and can be 'found' after selecting.  This is one of the downsides of modelbuilder unfortunately.  Exporting your model to a script to examine its contents might help dissect the problem if all else fails.

0 Kudos
RoshanTailor1
New Contributor

I am using the icon to select the appropriate file, I just manually typed in 'r' to see if that would work, but yes, the file directory was created automatically upon selection. It finds the file with no issue, but the error appears when I type in 'r', but even without 'r', it fails when running it?

0 Kudos