Hi All,
I'm getting the following error when attempting to addCalibrationPoints using the Linear Referencing Service applyEdits REST API function:
{'error': {'code': 500, 'message': 'Unable to complete operation.', 'details': []}}
I can manually add a calibration point in Pro using the Location Referencing Add Calibration Point tool; same service, same version.
This is what the applyEdits payload looks like:
https://MyServer/server/rest/services/MyService/MapServer/exts/LRServer/applyEdits
?f=json
&token=MyToken
&gdbVersion=MY.NAME@MY.ORG.AR_250212b
&sessionId={51777728-f672-4805-9831-b1800715f796}
&edits=
[
{"id": 1, "addCalibrationPoints":
[
{
"networkLayerId": 3,
"routeId": "LOC103431P",
"fromDate": 1522972800000,
"geometry": { "x": 441393.9140999997, "y": 3626705.8938999996}, "measure": 0.26968174 }
]
}
]
The CalibrationPoints service layer id is 1 and the Network service layer id is 3.
I don't believe geometry needs a spatialReference because the input geometry spatialReference matches the CalibrationPoints spatialReference, but I've tried it anyway with the same results.
I don't believe recalibrateRouteDownstream or retire are required either, but I've tried them anyway, with the same results.
I have successfully executed applyEdits to update Event fields (applyEdits/updates) and to retire a route (applyEdits/retireRoute) so it seems like I'm setting everything up properly. That basic workflow is:
This workflow very closely follows a presentation at the 2021 Developer Summit for adding a calibration point:
https://www.youtube.com/watch?app=desktop&v=VQzW-EZCEKc
Thanks for any help!
Solved! Go to Solution.
I resolved the problem, it was as simple as including the geometry "z" value since calibration points are PointZ geometry.
"geometry": { "x": 441393.9140999997, "y": 3626705.8938999996, "z": 0}, "measure": 0.26968174 }
I resolved the problem, it was as simple as including the geometry "z" value since calibration points are PointZ geometry.
"geometry": { "x": 441393.9140999997, "y": 3626705.8938999996, "z": 0}, "measure": 0.26968174 }
@Andy_Richardson thanks for posting the solution - its the little things.