Select to view content in your preferred language

Huff Model

3895
15
Jump to solution
10-03-2011 10:15 AM
rrjs67
by
Emerging Contributor
Hi

This is written for ArcGIS 9.3 however, I am using ArcGIS 10. The code is written as tool. by Mr. Drew Flater (http://arcscripts.esri.com/details.asp?dbid=15999).
Could anyone please change to ArcGIS 10 compatible?

I am getting the error with the sample data given with the tool:
<type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode characters in position 29-31: ordinal not in range(128)

and the error with my data is attached:

Thanks in advance.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
PhilMorefield
Frequent Contributor
Right-click on the tool, and select "Edit". You should see the script open up.

On line 10 you should see this:
gp = arcgisscripting.create(93)

Change it to this:
gp = arcgisscripting.create(9.3)

That got the tool working for me, using the example data. I'm on AGD 10.1, Windows XP.

View solution in original post

0 Kudos
15 Replies
DuncanHornby
MVP Notable Contributor
Have you tried contacting the Author of this script, they would have the best chance in correcting the error? You can contact them from the Arcscript page.
0 Kudos
rrjs67
by
Emerging Contributor
Thank you..
0 Kudos
SagarShah
Deactivated User
I am also facing an issue with this Script Tool. I get the following message:
---------
Executing: HuffModel GroceryStores Unique_ID Loc_Sales C:\Sagar\Huff_Model\Proof_of_Concept\Output2 te cntybnd Residences # true ND_HamCoStreets 2 NONE "Feature Set" false # #
Start Time: Wed Sep 19 23:18:30 2012
Running script HuffModel...
Finished checking inputs against parameter requirements.
PYTHON ERRORS:
Traceback Info:
  File "C:\Sagar\Huff_Model\AS15999\MarketAnalysisToolbox_update01262010\Script\HuffModel.py", line 371, in <module>
    attributes.reset()

Error Info:
    <type 'exceptions.AttributeError'>: 'list' object has no attribute 'reset'

GP ERRORS:

Completed script HuffModel...
Failed to execute (HuffModel).
Failed at Wed Sep 19 23:18:55 2012 (Elapsed Time: 25.00 seconds)

--------
I contacted Mr.Drew Flater before two days but have not received any reply from him. The last update was in 2010 and so there is a possibility that he is not actively working on this tool.http://arcscripts.esri.com/ContactAuthor.asp?dbid=15999

I don't know python and it would be really helpful if somebody can explain what does this error message mean. I tried to do an online search but no luck. I have attached the image of the error message.
0 Kudos
PhilMorefield
Frequent Contributor
The key piece of information is this:
<type 'exceptions.AttributeError'>: 'list' object has no attribute 'reset'

Here, 'attributes' is a property of a describe object. Apparently the geoprocesser used to return in iterator, but now it returns a Python list. Python lists don't have a 'reset' method. Thus the error.

You'll need to attach the data you are using in order for someone to troubleshoot the tool.
0 Kudos
PhilMorefield
Frequent Contributor
Right-click on the tool, and select "Edit". You should see the script open up.

On line 10 you should see this:
gp = arcgisscripting.create(93)

Change it to this:
gp = arcgisscripting.create(9.3)

That got the tool working for me, using the example data. I'm on AGD 10.1, Windows XP.
0 Kudos
SagarShah
Deactivated User
Thank you...Phil!
That totally worked.
0 Kudos
PhilMorefield
Frequent Contributor
Hi All,

I am having the same problem, and I try changing gp = arcgisscripting.create to (10.0) as I run on Arc 10, but I am still getting the same problem. Anyone have ideas how to resolve this issue?

Thanks in advance

Executing: HuffModel Auckland_firestations Name attract "C:\Mapping files\working\Decmeber files\Huff_tool\ToolData\SAMPLE" outputfeatureclass Auckland_FSA # # true NR2M_ND 2 NONE "Feature Set" true # #
Start Time: Fri Dec 20 12:00:59 2013
Running script HuffModel...
Finished checking inputs against parameter requirements.
PYTHON ERRORS:
Traceback Info:
  File "C:\Mapping files\custom_toolbox\Huff_model\Script\HuffModel.py", line 371, in <module>
    attributes.reset()

Error Info:
    <type 'exceptions.AttributeError'>: 'list' object has no attribute 'reset'

GP ERRORS:


Completed script HuffModel...
Failed to execute (HuffModel).
Failed at Fri Dec 20 12:01:02 2013 (Elapsed Time: 3.00 seconds)

Jeffrey-

You need to specify version 9.3 of the geoprocessor on line 11, even if you are using version ArcGIS 10.x. If you tried that and you're still getting an error, then that is a different issue.
RaymondChetti1
Emerging Contributor

Hi All (Phil Morefield‌ you can help with this since you seem to know about this?),

I am writing in regards to the Huff Model that Drew Flater posted on ESRI's website since I seem to be running into a problem with it. The model is not generating outputs for all of my supply points, including my planned store location, whenever I run the model with a network I've created. I've followed ESRI's tutorial on creating multi-modal/pedestrian networks.

I've got 172 supply points (cafes) + 1 (my potential site), but when I run the Huff Model toolbox the analysis only gives me outputs for 69 supply points? Why am I not getting outputs (probability & sales) for all 173 supply points? Screenshots are below. 
The model runs fine whenever I do not include a network, but I need the Huff Model to account for travel time/transportation networks.
Please note I have 141 Demand Points (polygons, neighborhoods) and 173 supply points in total:
NETWORK:
Inline image 1
Inline image 2
Inline image 3
SUPPLY POINTS OUTPUTS AFTER RUNNING HUFF MODEL TOOL:
Inline image 3
Inline image 2
MAP & SUPPLY POINTS FULL LIST:
 
Inline image 4
 
Inline image 5
Any feedback or help is most certainly appreciated! 
Cheers,
Ray
0 Kudos
ClintonDow1
Frequent Contributor

I'll mention this to Drew and see if we can get this script updated in the near future. 

edit: There is an updated version available at http://www.arcgis.com/home/item.html?id=f4769668fc3f486a992955ce55caca18  that should work with 10.x out of the box.