-1

I am using arcpy.Union_analysis to union two simple shapefiles. The output gives a new shapefile with the field names combined, but without the values (the attribute table of the output is empty).

Any idea why?

4
  • What happens when you use the same inputs with the Union tool from its tool dialog? Assuming you see the same problem then this will not be an ArcPy problem so I'll switch your tags.
    – PolyGeo
    Oct 28, 2016 at 8:36
  • I works perfectly with the Union tool from the tool dialog.
    – JrCaspian
    Oct 28, 2016 at 8:38
  • 1
    In that case use the Geoprocessing | Results window to right-click and Copy As Python Snippet to paste what you just ran successfully with the syntax in your not working script.
    – PolyGeo
    Oct 28, 2016 at 8:39
  • The problem was the extent environment, thank you!
    – JrCaspian
    Oct 28, 2016 at 8:48

1 Answer 1

0

To debug this I recommend performing these steps:

  1. Use the same parameter values with the Union tool from its tool dialog
  2. If it runs successfully, use the Geoprocessing | Results window to right-click and Copy As Python Snippet
  3. Paste the code snippet of that successful run into your script and compare its syntax with your line of non-working code.

Your Answer

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

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