[GIS] How to create a WFS from netCDF file(s)

geoservernetcdfopenlayers-2wfswms

Currently I'm working on a project that uses OpenLayers and Geoserver to view data from a postGIS server (both on a map through a WMS, and as data through a WFS).

Now, I'd like to be able to compare the output that I currently have with data from netCDF file(s).

So far I've tested ncWMS and used it as a WMS server, but as far as I know, if I want to get the raw data WMS supports getfeatureinfo, but here I can only display data from 1 pixel at a time, so to compare a lot of data would resolve in a huge amount of requests to the WMS server.

I'd like to find an alternative, where it would be easy for a user to compare his/her data from netCDF files with the data in the database. Of course users could download the raw data as is now, and then compare it somehow on their own, but that's not what we're interested in.

What Im thinking: the user gets an option to upload the file(s) to the application and then the application extracts whatever data it wants. I was perhaps thinking it would send the file to a server that would supply a WFS to the application.

I know it is possible to upload the netCDF to a postGIS database, but that seems like overkill? Or is it perhaps the most efficient way? I would also like an option that is reliable and not dependent on third-party software that might now be sufficiently tested or up to date.

I'm quite new to all of this and would really appreciate all help I could get 🙂

Edit:
I haven't figured this out yet. What I've moved onto now is to test the netCDF API for Java from uninet, see http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/v4.2/javadoc/ucar/nc2/package-summary.html

However, I'm having difficulties understanding how to extract point data from the arrays with raster data that I seemingly get out of it.

Best Answer

If you have moved on to the netCDF Java API it might be interesting for you to try Python as well. I have worked with Java for a while but find Python for number crunching and data analysis more convenient. Geoserver should be able to serve your postGIS data as NetCDF. You can then use Python or Java to generate a Netcdf file that contains the difference in each grid cell for example.

If you find out more about WCS I am highly interested as we work with NetCDF rasters a lot and would like to serve it as WCS.

A look at https://wiki.52north.org/bin/view/GEONETCAST/GeoserverVsMapserver might be a solution as well. I worked together with some of these guys in 2012 but am not up to date with their current implementations.