netcdf question

9 views
Skip to first unread message

alex...@gmail.com

unread,
Feb 21, 2020, 11:48:21 AM2/21/20
to Tethys Platform
Hi,

I'd like to be able to display netcdf file using geoserver data service by following the Shapefile example given at http://docs.tethysplatform.org/en/stable/tutorials/geoserver/upload_shp.html and also shown below. My question is where I should  put the netcdf file, and whether the path should be absolute path. In my case, I bind the data folder to geoserver docker, .tethys/geoserver/data. 

Thanks,
Alex
# Path to shapefile base for foo.shp, side cars files (e.g.: .shx, .dbf) will be
# gathered in addition to the .shp file.
shapefile_base = '/path/to/foo'

# Notice the workspace in the store_id parameter
result = dataset_engine.create_shapefile_resource(store_id='my_app:foo', shapefile_base=shapefile_base)

# Check if it was successful
if not result['success']:
    raise

Riley Hales

unread,
Feb 21, 2020, 7:37:06 PM2/21/20
to alex...@gmail.com, Tethys Platform
Alex,

As far as I know, GeoServer doesn’t support netcdfs. Thredds does support netcdfs and has some great tools for that. I would recommend using the Thredds docker container. You can follow your same procedure of mounting a directory to the Thredds container. Thats how I do it and it works well for my needs. There is documentation that has suggestions for using thredds with Tethys apps here: http://docs.tethysplatform.org/en/stable/tutorials/thredds.html

The steps for thredds at that link will use the CLI for tethys which I believe only works for tethys 3, however. If you’re using a tethys 2 environment and are not ready to upgrade to tethys 3, you’ll have to build the thredds docker container yourself. In that case, you’ll probably find this helpful https://github.com/Unidata/thredds-docker

Hope that helps,

Riley




--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tethysplatfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tethysplatform/92ef46e5-990d-4c45-873e-dd713125ef31%40googlegroups.com.

Riley Hales

unread,
Feb 21, 2020, 7:58:49 PM2/21/20
to Alex Sun, Tethys Platform
Alex,

I didn’t know you could show netcdf with geoserver. Thats really useful. I’ll have to research that more, thanks.

It is definitely possible to show multiple layers from GeoServer or a combination of GeoServer and Thredds. I’ve never tried to do that using the MVLayer gizmo, though. I usually write my own JavaScript for applications that are going to need lots of layers since I usually end up wanting to have more control over the layers interacting. Its a lot of javascript to review but you could look at my app for interacting with GLDAS datasets which are all netcdfs. https://github.com/rileyhales/gldas https://tethys.byu.edu/apps/gldas The version of the app hosted at the link I sent is running tethys2 and isn’t the version on the master branch of that GitHub repo, in case you try to compare them. You can download that app and test it locally to see what it looks like with tethys3.

Anybody have more experience using the MVLayer gizmo to do this?

Riley

On Feb 21, 2020, at 5:44 PM, Alex Sun <alex...@gmail.com> wrote:

Hi, Riley,

Thanks for the reply. I spent more than 0.5 day on this issue today. What I learned is Geoserver does support netcdf, but I'm not sure how to configure it programmatically to display a netcdf generated at runtime (that's my original question). I could do it through the geoserver web interface.

I installed thredds, but I'd like to display netcdf together with shape layers served by Geoserver. Is this possible (e.g., MVLayer)? If so, can someone please provide a working example?

Thanks,
Alex
Reply all
Reply to author
Forward
0 new messages