What is the format for the search radius parameter in the Spatial Join in a python script?
I've tried a numeric value (5), 5 feet, and 5-feet.
Another way of checking is to use ModelBuilder. Add the Tool to the model and define all the desired parameters. Then, export the Model to Python Script.
Hope it helps!!!
Hi, I'm stumped, the function looks right, it is possible there is something in your data that is causing an issue, maybe linear referencing related if thats what you are working with. Lets go with a support call. Sorry it isn't jumping out at me.
Bruce,
Thanks for the heads up. I've changed the spatial join arguments as show below and it is still returning "ERROR 999998".
Any other ideas before I call support?
arcpy<SPAN class="punctuation token">.</SPAN>SpatialJoin_analysis<SPAN class="punctuation token">(</SPAN>target_features<SPAN class="operator token">=</SPAN><SPAN class="string token">"C:/tmp/KMZ_Work/RouteData3/KML_Data3.gdb/PointsAlongRoutes"</SPAN><SPAN class="punctuation token">,</SPAN> join_features<SPAN class="operator token">=</SPAN><SPAN class="string token">"C:/tmp/KMZ_Work/RouteData3/KML_Data3.gdb/MergedRoutes"</SPAN><SPAN class="punctuation token">,</SPAN> out_feature_class<SPAN class="operator token">=</SPAN><SPAN class="string token">"C:/tmp/KMZ_Work/RouteData3/KML_Data3.gdb/PointsJoinedToRoutesTest2"</SPAN><SPAN class="punctuation token">,</SPAN> join_operation<SPAN class="operator token">=</SPAN><SPAN class="string token">"JOIN_ONE_TO_ONE"</SPAN><SPAN class="punctuation token">,</SPAN> join_type<SPAN class="operator token">=</SPAN><SPAN class="string token">"KEEP_ALL"</SPAN><SPAN class="punctuation token">,</SPAN>match_option<SPAN class="operator token">=</SPAN><SPAN class="string token">"INTERSECT"</SPAN><SPAN class="punctuation token">,</SPAN> search_radius<SPAN class="operator token">=</SPAN><SPAN class="string token">"5 Feet"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Michael, try not supplying the field mapping, I'm not sure an empty string will work. You'll need to name parameters after switching from kwargs, like match_option="INTERSECT",search_radius='10 Feet')
Thanks Bruce and Jayanta for the reply. But, it does not appear to want to work using any value for the search radius. I'm only able to get the spatial join to run is with no value in the search radius.
May have to open a support ticket.
Snippet of the code used
outPoints = "PointsAlongRoutes" joinFeats = "MergedRoutes" outJoinFeat = "PointsJoinedToRoutes3" joinOp = "JOIN_ONE_TO_ONE" joinType = "KEEP_ALL" fieldMapping = "" matchOption = "INTERSECT" searchRadius = "10 Feet" distanceField = "" arcpy.SpatialJoin_analysis(outPoints, joinFeats, outJoinFeat, joinOp, joinType, fieldMapping, matchOption, searchRadius, distanceField)
You could write the parameter as "5 Feet".
Numeric Value with Units enclosed in Double Quotes.
'5 Feet'
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.