Reading-eScience-Centre / edal-java

Environmental Data Abstraction Layer libraries
Other
39 stars 30 forks source link

Incorporate CoverageJSON into ncWMS #37

Closed guygriffiths closed 8 years ago

guygriffiths commented 8 years ago

It would be nice to be able to download data via ncWMS. It is currently possible to download a simple CSV at a point, but (optionally) exposing the data in a format such as CoverageJSON would be a nice addition.

letmaik commented 8 years ago

I guess a good way to make this happen would be to separate the edal-to-covjson part out of edal-json into an own library so that you can simply give it a feature and it returns a CoverageJSON coverage document. Would that work? When edal/ncWMS does resampling and subsetting (to the map extent/resolution), does that actually result in a new Feature object with adjusted domain etc? That would make it a lot easier.

guygriffiths commented 8 years ago

That sounds like a good approach. When we extract the data to show a map we do create a full Feature object. As well as making the implementation easier, it would also be really useful for exporting CoverageJSON for datasets which are in a CRS which CoverageJSON doesn't handle (e.g. Gerardo's land cover data had to be regridded before we could plot it on the remapping tool - this would allow us to do that on-the-fly)

letmaik commented 8 years ago

Great! (the creation of a full new Feature)

And yes, basically it would be an API that returns coverages with support for subsetting and resampling/reprojection, since WMS supports that for maps. Note that CoverageJSON will support any CRS, it is more a question of what the client can handle, so regridding to lon/lat is a useful operation.

letmaik commented 8 years ago

Should this new covjson-export library be implemented as a module in the edal-java repository?

guygriffiths commented 8 years ago

I think so, yes. It would be used in the edal-wms module so I think it belongs in the edal-java repository.

It could potentially include other formats (subsetting to NetCDF would be a useful piece of functionality to have).

On a related topic we may at some point factor out ncWMS into a separate repository, but the vast majority of the functionality of ncWMS is implemented in the edal-wms and edal-xml-catalogue modules.

letmaik commented 8 years ago

I would put a NetCDF export in a separate module, since then people who want to use edal modules individually can more easily skip stuff they don't need.

Let's call it edal-coveragejson. Could you give me a headstart and create the structures of this new module including the interfaces that you would use from within the wms code? Then I can get in and fill out the details.

guygriffiths commented 8 years ago

Sure, I'll probably get on with that tomorrow

guygriffiths commented 8 years ago

The coverage-json branch now contains a skeleton project ready for this.

letmaik commented 8 years ago

Ok looks good, I will probably start work on that in a week or two.

letmaik commented 8 years ago

I implemented the edal-coveragejson module in the coveragejson branch. What's missing is the wiring to the WMS code.

letmaik commented 8 years ago

Done and tested! I guess we'll leave this issue open until we've decided what to do with the coveragejson branch. If we merge it, then possibly we need additional features like being able to disable this format.

guygriffiths commented 8 years ago

This is all done and released. By enabling the "Download" option in ncWMS admin, users can call GetMap with the format application/prs.coverage+json and it'll download CoverageJSON