USACE / cwms-data-api

Corps Water Management System RESTful Data Service
MIT License
11 stars 14 forks source link

CDA location end point rounding of elevation #623

Open JeremyDKellett opened 5 months ago

JeremyDKellett commented 5 months ago

Request CDA round the elevation attribute to 2 or 4 digits,

to replicate: https://cwms-data.usace.army.mil/cwms-data/locations/UVD?office=NAE

{ "office-id": "NAE", "name": "UVD", "latitude": 43.7937221, "longitude": -72.2575215, "active": true, "public-name": "Union Village Dam", "long-name": "Union Village Dam, Ompompanoosuc River", "description": "Union Village Dam, Ompompanoosuc River", "timezone-name": "America/New_York", "location-type": "Pool Gage", "location-kind": "PROJECT", "nation": "US", "state-initial": "VT", "county-name": "Orange", "nearest-city": "Lebanon", "published-longitude": 0, "published-latitude": 0, "vertical-datum": "NGVD29", "elevation": 419.99999999999994, "map-label": "UVD - Union Village Dam", "bounding-office-id": "NAE" }

rma-rripken commented 5 months ago

Its not my call but I don't agree. The database stores elev as binary_double, which we can serialize as a java double with no loss of information. Why should CDA return rounded values? I assume there is a reason those elevations were inserted into the database with the values they have in the database. I'd want CWMSVue or other apps that use CDA as a datasource to get back data that matches the database. If rounding was going to happen I'd think it would happen in an application or user interface not in the data provider. But again, not my call, just my opinion,

MikeNeilson commented 4 months ago

I'm with Ryan here. CDA is a very general purpose API, it should not round anything in transit to the user.