2

I can't seem to find much in forums about this - I'm trying to use Tabulate Intersection with two shapefiles.

When run in a model, I get a generic error (Error 999999:Error executing function). When run in a Python script, I get the following:

    Traceback (most recent call last):   File
    "H:/Scripts/IntersectTable_test.py", line 18, in <module>
    arcpy.TabulateIntersection_analysis (in_zone_features, {'distance'}, in_class_features, out_table, {'INFO'}, '','','')   File
    "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\analysis.py", line
     1122, in TabulateIntersection
     raise e RuntimeError: Object: Error in executing tool

....this makes it difficult to diagnose problem. Anyone with experience/know what I'm missing? I'm working in Arc10.1 and have all license access. I've edited this post to include the code I'm using to test this before adding it to a larger, more complex script:

    import os
    import arcpy
    import sys
    from arcpy import env
    import csv

    ##Set overwrite
    arcpy.env.overwriteOutput = True

    ##Set variables
    in_zone_features = r'C:\BOEM\QuartRings\Scratch\quartrings_points_proj_multrings.shp'
    zone_fields = 'distance'
    in_class_features = r'C:\BOEM\Basic_NE_Fisheries.gdb\ALL_WEA_Simplified_3_2013'
    out_table = r'C:BOEM\QuartRings\Scratch\buff_intersect_table'

    arcpy.TabulateIntersection_analysis (in_zone_features, {'distance'}, in_class_features, out_table, {'INFO'}, '','','')
2
  • I did just find the following: forums.arcgis.com/threads/… - which suggested repairing geometry on the inputs to Tabulate Intersection. This still did not solve the issue; still have same non-specific error.
    – SharonB
    Mar 20, 2013 at 20:03
  • Can you post your code? It may be a simple syntax error.
    – dmahr
    Mar 21, 2013 at 13:49

1 Answer 1

4

I think your syntax is off in your final line of code. Try the following:

arcpy.TabulateIntersection_analysis(in_zone_features, 'distance', in_class_features, out_table, 'INFO')

The curly brackets { and } in the Tabulate Intersection help page signify optional parameters. You don't need to put them in your code, however.

5
  • Thank you but it brings the same error....Error 999999 doesn't help figure out the issue. But I will keep {} out of code in the future, thanks.
    – SharonB
    Mar 21, 2013 at 14:48
  • Try the (now revised) code above. I removed the erroneous space between ..._analysis and (in_zone... and got rid of the unecessary parameters at the end. I would test this myself, but I don't have an ArcGIS Advanced license.
    – dmahr
    Mar 21, 2013 at 14:55
  • Still good edits, but still Error 999999.
    – SharonB
    Mar 21, 2013 at 15:06
  • 1
    One other idea: change your out_table variable to be a .dbf file instead of a file with no extension. If that doesn't work, I would try just running the regular tool from the GUI. Once you get it working, right click the run from the Results pane and click "Copy as Python snippet" and see how the syntax is different.
    – dmahr
    Mar 21, 2013 at 15:50
  • In my test model, adding the XX.dbf to the file name worked. Thank you! Huzzah. The trick will be if it works when I run it in the main body of the larger script.
    – SharonB
    Mar 21, 2013 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.