INSTALL/CONFIGURE NCWMS
ncWMS is a web mapping service for geospatial data that is able to serve NetCDF files (heavily used to store the output from the ocean and atmospheric models). OWGIS has the ability to show layers that come from ncWMS servers. To install ncWMS on Tomcat:
- Download the WAR from this link.
- Upload the war file to tomcat using the manager: http://localhost:8080/manager/html in the WAR file to deploy section
- Add the administrator role of ncWMS (ncWMS-admin) and a user that will take that role to Tomcat in the tomcat-users.xml file:
sudo vi /usr/local/tomcat/conf/tomcat-users.xml
Then add to the file:
<role rolename = "ncWMS-admin" />
<user username = "admin" password = "ncWMSpassword" roles = "ncWMS-admin" />
- Test ncWMS at: http://localhost:8080/ncWMS2/admin with the user that you created and it should look like the following image:
Now you can add any netCDF with your data to the ncWMS server and be able to see it using OWGIS!
Adding datasets to ncWMS and display it with OWGIS
To add a dataset to ncWMS you need your geospatial data stored in a CF-compliant NetCDF file.
On the admin page of ncWMS, new datasets can be added by filling in the information in the "Required Data" column of the Datasets section. All other fields are optional, the basic sections you should fill to be able to use the layer in OWGIS are:
- ID: An alphanumeric identifier for the dataset. This must be unique on the server.
- Title: The title of the dataset. This is displayed in menus, etc. on the user interface.
- Location: The location of the dataset. This should be either a location on disk or an OPeNDAP URL. Note that locations should use slashes - not backslashes - regardless of the operating system. For example, on Windows a path such as C:/Data/dataset.nc should be used. If referring to a location on disk, glob expressions of the form /mnt/data/dataset/**/**/*.nc are valid. If such an expression refers to multiple NetCDF files, they will be interpreted as having non-overlapping time axes. Any other configuration of data spanning multiple files is not supported, although ncWMS2 does have support for NcML for more complex aggregations. If you are using NcML, the .ncml file should be referenced in the location field.
- Auto-refresh rate: Specifies how regularly the dataset will be scanned for changes
- In the Options sections you should select both Queryable (Whether or not to allow GetFeatureInfo requests to this dataset) and Downloadable (Whether or not to allow data download for this dataset).
After you add an entry to ncWMS you should always click the Save configuration button in order to actually save the changes in the server.
Now that you have a dataset added to ncWMS you can use it to display a variable as a layer in OWGIS. To do this you only have to add a few lines to an XML archive inside the layers folder of your project. You can see more information on how to do this in Layer configuration.
An example will be:
<layer Menu="ncwms,worldCurrents" EN="World Currents" name="hycom_forecast_uv/water_u:water_v-mag"
defParticleSpeed=".9" overlaystreamlines="hycom_forecast_uv/water_u:hycom_forecast_uv/water_v" />