Select to view content in your preferred language

applyEdits creates multiple copies of routes along with calibration points as passed in edits JSON

376
3
Jump to solution
11-22-2024 05:27 AM
Sergio
by
Emerging Contributor

Hello!

I see very strange behavior of the applyEdits endpoint when trying to upload set of calibration points. It creates not just calibration points but set of routes copies to which I'm trying to apply calibration points. Here is the example of JSON I pass to the endpoint:

[
    {
        "id": 1,
        "addCalibrationPoints": [
            {
                "networkLayerId": 33,
                "routeId": "{RouteNo1}",
                "geometry": {
                    "x": 7933907.5401063189,
                    "y": 7793303.80977148,
                    "z": -24,
                    "spatialReference": {
                        "latestWkid": 3857,
                        "wkid": 102100
                    }
                },
                "fromDate": 1170374400,
                "toDate": 1170460800,
                "measure": 134.07499999999999,
                "recalibrateRouteDownstream": 0,
                "retire": 0
            },
            {
                "networkLayerId": 33,
                "routeId": "{RouteNo1}",
                "geometry": {
                    "x": 7933929.4377417713,
                    "y": 7793317.261703142,
                    "z": -24,
                    "spatialReference": {
                        "latestWkid": 3857,
                        "wkid": 102100
                    }
                },
                "fromDate": 1170374400,
                "toDate": 1170460800,
                "measure": 155.857,
                "recalibrateRouteDownstream": 0,
                "retire": 0
            },
            {
                "networkLayerId": 33,
                "routeId": "{RouteNo1}",
                "geometry": {
                    "x": 7934213.5078702234,
                    "y": 7793274.3926343555,
                    "z": -25,
                    "spatialReference": {
                        "latestWkid": 3857,
                        "wkid": 102100
                    }
                },
                "fromDate": 1170374400,
                "toDate": 1170460800,
                "measure": 355.46199999999999,
                "recalibrateRouteDownstream": 0,
                "retire": 0
            }
        ]
    }
]
 
In response I get JSON log that apart from calibration points polylines were created and when I go to my version I see all these lines created as routes. Anyone saw such behaviour? Maybe something with my query parameters? But I pass only "edits", "gdbVersion" and "sessionId" and all this passes (otherwise I would get error with reference to invalid parameter).
0 Kudos
1 Solution

Accepted Solutions
AyanPalit
Esri Regular Contributor

@Sergio My understanding on the issue is set of routes copies created when adding calibration points. This is likely due to the From Date/To Date mismatch between  calibration point records and the corresponding route records. LRS is natively time aware and based on the data (Date/Time attribution) may introduce time slices. Users not aware of this are thrown off-guard and puzzled with the duplicate records as in your case.

  • Note the From Date/To Date of the route {RouteNo1}
  • Use the same From Date/To Date for the calibration points to be added on {RouteNo1}
  • Review the attribute table of the layers after the data load.
  • Generate Routes and QC
Ayan Palit | Principal Consultant Esri

View solution in original post

3 Replies
AyanPalit
Esri Regular Contributor

@Sergio My understanding on the issue is set of routes copies created when adding calibration points. This is likely due to the From Date/To Date mismatch between  calibration point records and the corresponding route records. LRS is natively time aware and based on the data (Date/Time attribution) may introduce time slices. Users not aware of this are thrown off-guard and puzzled with the duplicate records as in your case.

  • Note the From Date/To Date of the route {RouteNo1}
  • Use the same From Date/To Date for the calibration points to be added on {RouteNo1}
  • Review the attribute table of the layers after the data load.
  • Generate Routes and QC
Ayan Palit | Principal Consultant Esri
Sergio
by
Emerging Contributor

Thanks again @AyanPalit  - as always your advise led to the solution. I've set the fromDate to the fromDate value of the route and everything loaded properly without duplicates of routes. One issue I couldn't resolve yet is related to datetime format. As you see on the sample of JSON I've provided earlier the datetime is in epoch format and equals to 1170374400, which is GMT: Friday, February 2, 2007 12:00:00 AM  

But in the SDE (through the published service as it is LRS) I see that these records were written with wrong values - 1/14/1970.

Could you please advise why is this happening? Does SDE (or feature service) recognizes epoch format wrong or with some specifics? What API endpoint expects the datetime should be? From the documentation I see that it should be epoch datetime which is number of seconds since  Jan 1st 1970.

0 Kudos
Sergio
by
Emerging Contributor

A bit of topic, but if anyone face with the same issue, solution is to use 13 digits epoch format. So in my case I've added 000 to the end of my values (1170374400) and date loaded as expected.

0 Kudos