I'm trying to snap multiple point features to a line using the arcgis API for Python. The arcpy method isn't viable for the end-users of this tool as they don't have consistent access to an Advanced Use license.
What I'd like to be able to do is find the nearest line to each point, then snap that point to that nearest line. I've tried two methods here, iterating through the features in the feature service as below...
<SPAN class="keyword token">import</SPAN> arcgis
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>features <SPAN class="keyword token">import</SPAN> FeatureLayer<SPAN class="punctuation token">,</SPAN> use_proximity
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>geometry <SPAN class="keyword token">import</SPAN> Geometry<SPAN class="punctuation token">,</SPAN> Point<SPAN class="punctuation token">,</SPAN> Polyline
point_svc <SPAN class="operator token">=</SPAN> <SPAN class="string token">"service url"</SPAN>
line_svc <SPAN class="operator token">=</SPAN> <SPAN class="string token">"service url"</SPAN>
point_ft <SPAN class="operator token">=</SPAN> FeatureLayer<SPAN class="punctuation token">(</SPAN>point_svc<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>query<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>features
line_ft <SPAN class="operator token">=</SPAN> FeatureLayer<SPAN class="punctuation token">(</SPAN>line_svc<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Go through each point in the point feature layer, and find its nearest line feature. Then,</SPAN>
<SPAN class="comment token">#snap that given point to the nearest line feature.</SPAN>
<SPAN class="keyword token">for</SPAN> p <SPAN class="keyword token">in</SPAN> point_ft<SPAN class="punctuation token">:</SPAN>
<SPAN class="comment token">## The FeatureInput documentation states that both the analysis and near </SPAN>
<SPAN class="comment token">##features need to be items, a FeatureLayer or FeatureCollection instance, or a Feature </SPAN>
<SPAN class="comment token">##Service URL string. </SPAN>
nearest <SPAN class="operator token">=</SPAN> use_proximity<SPAN class="punctuation token">.</SPAN>find_nearest<SPAN class="punctuation token">(</SPAN>p<SPAN class="punctuation token">,</SPAN> line_ft<SPAN class="punctuation token">)</SPAN>
new_pt <SPAN class="operator token">=</SPAN> p<SPAN class="punctuation token">.</SPAN>snap_to_line<SPAN class="punctuation token">(</SPAN>nearest<SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>This option, predictably according to the FeatureInput documentation, doesn't like the input layer formats.

What does work for at least creating a nearest line layer is using the point_svc and line_svc as inputs, but I'm very lost as to how I can use the resulting feature layer collections to snap the points to the lines...
nearest = use_proximity.find_nearest(point_svc, line_svc)
nearest
{'nearest_layer': <FeatureCollection>, 'connecting_lines_layer': <FeatureCollection>}<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The 'nearest_layer' Feature Collection that's output has a "SNAP_" and "SNAP_ID" field that I would assume relate to the Object ID of the points in the analysis layer, but unfortunately, they don't relate, and I can find no other field in that output Feature Collection that relates to the point on which the find_nearest was based (unless find_nearest doesn't compare features to features, but rather entire services to services...).
Point service OIDs (three points in total):

find_nearest output Feature Collection item attributes:

Does anyone know any cleaner methods of accomplishing this task using the API, or how to then work with the nearest feature collection to then reference the points in the points feature service to those nearest lines and then snap them?