Handling Location DTO change to include VerticalDatumInfo #1565
-
|
Background As part of ongoing work to support Vertical Datum for TimeSeries, Ratings, and Locations, a VerticalDatumInfo object is used to handle conversions to other datums. At present, Location does not use a VerticalDatumInfo object, but it was decided that it should for consistency with the other resources. Problem Introducing VerticalDatumInfo for Locations will result in a different response shape than what has historically been used. Specifically:
are no longer flat fields, and are instead represented via the VerticalDatumInfo object. This is a breaking change for existing clients that consume Location representations in the current format. Question / Discussion What is the recommended procedure for handling breaking DTO / response-shape changes like this while maintaining compatibility with clients that rely on older formats? We discussed a couple of potential approaches:
Before moving forward, we wanted to open this discussion to confirm:
Example of change: Old: {
"name": "LOC_TEST",
"latitude": 38.5816,
"longitude": -121.4944,
"public-name": "LOC_TEST",
"long-name": "LOCATION_TEST",
"description": "For Testing",
"timezone-name": "UTC",
"location-kind": "SITE",
"nation": "US",
"state-initial": "CA",
"county-name": "Sacramento",
"nearest-city": "Sacramento",
"horizontal-datum": "NGVD-29",
"published-longitude": 38.5816,
"published-latitude": -121.4944,
"vertical-datum": "NGVD-29",
"elevation": 36.089,
"elevation-units": "ft",
"map-label": "label",
"bounding-office-id": "SPK",
"office-id": "SPK"
}New: {
"name": "LOC_TEST",
"latitude": 38.5816,
"longitude": -121.4944,
"public-name": "LOC_TEST",
"long-name": "LOCATION_TEST",
"description": "For Testing",
"timezone-name": "UTC",
"location-kind": "SITE",
"nation": "US",
"state-initial": "CA",
"county-name": "Sacramento",
"nearest-city": "Sacramento",
"horizontal-datum": "NGVD-29",
"published-longitude": 38.5816,
"published-latitude": -121.4944,
"map-label": "label",
"bounding-office-id": "SPK",
"office-id": "SPK"
"vertical-datum-info": {
"unit": "ft",
"native-datum": "NGVD-29",
"elevation": 36.089,
"offsets": [
{
"to-datum": "NGVD-29",
"value": 0.0,
"estimate": false
},
{
"to-datum": "NAVD-88",
"value": -2.532,
"estimate": true
}
]
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
|
@MikeNeilson @rma-rripken @adamkorynta @krowvin @msweier @rma-psmorris - tagging for discussion |
Beta Was this translation helpful? Give feedback.
-
|
The rest of the json is kebab-case is the vertical datum going to be camel? |
Beta Was this translation helpful? Give feedback.
-
|
In order of my opinion high to low Consider
Keep original same A paramter A new response version
|
Beta Was this translation helpful? Give feedback.
-
|
I like Charles #1. That way the existing Location DTO wouldn't have to change. The new datum controller would (presumably) be fast b/c its just the vertical-datum-info and not the rest of the Location metadata. It is possible also to add vertical-datum-info to Location in a way that wouldn't break existing clients but I don't like it b/c it makes the DTO ambiguous - pulling the vertical-datum-info out completely seems much cleaner. TimeSeries and Ratings also have vertical-datum-info. Similar end-points could be added for them. But then again those vertical-datum-info are just the vertical-datum-info of the associated Location so adding end-point for them wouldn't be that helpful. Who asked for/needs vertical-datum-info? Does @msweier use it? Maybe we can hear what they think. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah it was me, but I know of other districts that are just tracking datum conversions without cwms since this isn't exposed (I suspect many). I agree with Charles. I was thinking of something like a The veritical-datum-info from the location is inherited for timeseries, ratings etc.. correct? I can't think of a reason why a datum conversion would be different for a timeseries or rating at the same location. Right now, it seems like the vertical datum info is based on an elevation conversion (offsets). I could also see the need for the conversion from the stage to a given elevation (I often see that info displayed from stage to elevation). I realize this may be more a database issue, and I can back out what I need from the elevation and offsets....but food for thought. |
Beta Was this translation helpful? Give feedback.
-
|
Will move forward with adding a datum endpoint. Created a github ticket to track: #1577 |
Beta Was this translation helpful? Give feedback.
I like Charles #1. That way the existing Location DTO wouldn't have to change. The new datum controller would (presumably) be fast b/c its just the vertical-datum-info and not the rest of the Location metadata.
It is possible also to add vertical-datum-info to Location in a way that wouldn't break existing clients but I don't like it b/c it makes the DTO ambiguous - pulling the vertical-datum-info out completely seems much cleaner.
TimeSeries and Ratings also have vertical-datum-info. Similar end-points could be added for them. But then again those vertical-datum-info are just the vertical-datum-info of the associated Location so adding end-point for them wouldn't be that helpful.
Who ask…