-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAP4: url with .dap.csv?...
does not display tabular data correctly on the browser
#919
Comments
.dap.csv?...
does not display data correctly on the browser - DAP2 does.dap.csv?...
does not display tabular data correctly on the browser
This is a browser thing and not a bug. For the DAP4 csv request:
The server returns the following response headers:
And the browser determines that the content should be downloaded and not displayed. The DAP2 ascii response:
Returns the response headers:
Which browsers are happy to display. The DAP2 ascii response and it headers are "historic/legacy" and do not really conform to the semantics of the modern web. I believe that the DAP4 response headers are correct. Additionally it's important to remember that the DAP4 service supports HTTP 1.1 client/server content negotiation which can make things confusing when using a browser to interact with the service. See section 4 of DAP4 Volume 2. For example when browser is used to deference the URL: If there is an issue with the content (which there surely is) we should discuss, as "CSV" might nominally be expected to be something more "tabular" rather then the "discrete" form which is returned currently. References:
I'll be back next week and we can discuss, or see @jgallagher59701 for more context. |
Thanks @ndp-opendap ! |
Description of problem
I tried to visualize data on the browser in tabular form. With DAP2 everything seems to work as expected, but with DAP4 things don't go as planned.
What I did
DAP2 works
Pasting this url: http://test.opendap.org/opendap/data/nc/sst.mnmean.nc.gz.ascii?sst[3][4][5] on a browser shows:
DAP4 does not
If I paste the dap4 url: http://test.opendap.org/opendap/data/nc/sst.mnmean.nc.gz.dap.csv?dap4.ce=/sst[3][4][5] onto a browser it downloads the sst.mnmean.nc.gz.csv file. Looking at its contents with a simple text editor
With pandas:
That is pretty confusing.
If I set the url instead as http://test.opendap.org/opendap/data/nc/sst.mnmean.nc.gz.dap.csv?dap4.ce=/sst[3:4][4:5][5:6], it downloads a csv with the sst.mnmean.nc.gz.csv file with values now:
Expected behavior?
With DAP4 I was expected to see the browser data in tabular form as in DAP2 case. Instead:
a) Downloads data rather than visualize on browser.
b) When inspecting the contents of the
csv
file, the data seems incorrect.The text was updated successfully, but these errors were encountered: