Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Cheers

for tracker in trackerPoints:

    trackerLoc = workingFolder +"\\" + tracker

    gpsReproject = gpsID + "_Reproject"
    arcpy.Project_management(trackerLoc,gpsReproject,"PROJCS['TM65_Irish_Grid',GEOGCS['GCS_TM65',DATUM['D_TM65',SPHEROID['Airy_Modified',6377340.189,299.3249646]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',200000.0],PARAMETER['False_Northing',250000.0],PARAMETER['Central_Meridian',-8.0],PARAMETER['Scale_Factor',1.000035],PARAMETER['Latitude_Of_Origin',53.5],UNIT['Meter',1.0]]","TM65_To_WGS_1984_2","GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433],METADATA['World',-180.0,-90.0,180.0,90.0,0.0,0.0174532925199433,0.0,1262]]")

    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

 
discard

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

Browse other questions tagged or ask your own question.