Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a script which loops through a series of FC layers (tracker points). Using a FOR loop, they're reprojected then joined to a streets layer.

Sometimes it works fine, then other times it never completes the spatial join and stays hanging in debugging mode & I have to manually stop it. It does the reproject OK, just not the join.

Any idea why it might be doing this?


for tracker in trackerPoints:

    trackerLoc = workingFolder +"\\" + tracker

    gpsReproject = gpsID + "_Reproject"

    gpsJoin = gpsID + "_Join"
    arcpy.SpatialJoin_analysis(gpsReproject,streets,gpsJoin,"JOIN_ONE_TO_ONE","KEEP_ALL","","CLOSEST","#","Distance")  # Spatial Join streets & tracker points
share|improve this question
Have you tried putting the SpatialJoin in its own FOR loop? – gm70560 May 24 '13 at 13:35
I have recently being doing some processing using arcpy in pyscripter and was experiencing the hanging problem during debug. I just ran the code in IDLE and it seemed to work. So in my case it was not the code it seemed to be pyscripter playing up – Hornbydd May 24 '13 at 15:02
I'll try that gm, thanks – Mike May 24 '13 at 16:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.