Hi,
We are using Field Maps for aerial surveys and the altitude value of the points collected is very important in survey estimates. We understand that points collected directly at your location are attributed with the GPS metadata, but if the points are offset no metadata is included.
As a post-survey work around I need to determine the altitude from the nearest tracker points for all offset points. We have been trying to use the arcgis API for Python to go through each point in the survey point feature layer, find the nearest track point and altitude value, then update the survey point altitude with the nearest track point altitude value.
Similar to this post, we are getting the Exception: Invalid format of input layer. Below is an example of the code we have tried. According to the api-reference, the input types should accept simple point coordinates and the lat., long. pair should be fine, but this does not work. Is there a way to get the input to accept a feature or a feature converted to a point geometry object?
Can someone please assist!
tracks_lyr = FeatureLayer(tracks_svc)
i = 0
for key, value in calc_dict.items():
while i in range(len(calc_dict.items())):
print(i)
for point in key:
oid = point.attributes['OBJECTID']
print(oid)
x = point.geometry["x"]
y = point.geometry["y"]
pt_coord = (x,y)
tracks_nearby = find_nearest(analysis_layer = pt_coord, near_layer=tracks_lyr, measurement_type="StraightLine", max_count =3)
print(tracks_nearby)
try:
for r in cur:
with arcpy.da.UpdateCursor(herring_svc, ["ESRIGNSS_ALTITUDE"]) as cur:
if r[0] == 1500:
print(r[0])
cur.updateRow(r)
else:
print("pt has altitude value of " + str(r[0]))
except Exception as e:
#arcpy.AddMessage("Error updating point: " + str(e))
print("Error updating point: " + str(e))
Thanks in advance!
Kathy