[Geoserver-devel] Support for renaming published dimensions

Good morning,

As there is currently no OGC method (that I am aware of) for dimension discovery, clients have to know what dimension names to use when interacting with a multi-dimensional OGC service. Even in instances where dimension attribution could be used to infer the type of dimension, there is no way to differentiate the purposes of similar typed dimensions other than the dimension name until something resembling dimension discovery is standardized. For example, a forecast coverage may have two time dimensions - one is the forecast model run time and one is forecast validity time.
The client has to “know” that the dimension “reference_time” is the forecast model run time, and that “time” is the forecast validity time. Furthermore, creators of software clients have to embed this special knowledge into client software. As a result, the service owners must be able to advertise dimension names consistently, regardless of changes in underlying reader / data libraries in order to maintain client compatibility and conform to any organizational standard names or naming conventions.

I’d like to offer my current use case as an example:

Under normal circumstances, we use the FMRC capabilities provided by netCDF-java via featureCollection XML files to aggregate datasets with different runtimes (these datasets are themselves NCML aggregations of .nc files). When opening such a featureCollection in java, we get a dataset that that has a dimension variable named ‘run’ for the different run times, and everything works beautifully. However, I’m working on a project where we have a custom runtime dimension configured as “reference_time” which is a requirement from our customer. When the netCDF plugin encounters the metadata configuration for the custom dimension in the coverage configuration it attempts to look up a “reference_time” dimension in the netCDF dataset. In this case, the plugin will not locate the correct runtime dimensions and throws a null pointer exception in some WCS / WMS operations. The exceptions in the service occur because Geoserver assumes that coverages are configured a certain way.

I am proposing a design for Geoserver to allow the user to define what the custom dimension name is, thereby giving the implementers greater flexibility and enable a way to get past the null pointer exception as well as allowing Buisness level standards for naming conventions with their interfaces.

I envision a setting in the dimension tab when viewing a published layer which will map custom dimension names available in the dataset to a user defined string. This string would be stored in the coverage.xml under the custom dimension element as an advertised name, perhaps as an example: “run”. When Geoserver then computes the custom dimension (and here is where I’m not sure it should ultimately be done) for example, when determining the “dimensionName” (as used in AbstractDefaultValueSelectonStrategy.java) Geoserver will first check for the “” element and use it’s contents henceforth, otherwise default to the custom dimension name as usual.

Thank you for your time,
Matt Campbell

On Wed, Mar 21, 2018 at 2:47 PM, Matthew Campbell <mjmcee@anonymised.com> wrote:

Under normal circumstances, we use the FMRC capabilities provided by
netCDF-java via featureCollection XML files to aggregate datasets with
different runtimes (these datasets are themselves NCML aggregations of .nc
files). When opening such a featureCollection in java, we get a dataset
that that has a dimension variable named ‘run’ for the different run times,
and everything works beautifully. However, I’m working on a project where
we have a custom runtime dimension configured as “*reference_time*” which
is a requirement from our customer. When the netCDF plugin encounters the
metadata configuration for the custom dimension in the coverage
configuration it attempts to look up a “*reference_time*” dimension in
the netCDF dataset. In this case, the plugin will not locate the correct
runtime dimensions and throws a null pointer exception in some WCS / WMS
operations. The exceptions in the service occur because Geoserver assumes
that coverages are configured a certain way.

I am proposing a design for Geoserver to allow the user to define what the
custom dimension name is, thereby giving the implementers greater
flexibility and enable a way to get past the null pointer exception as well
as allowing Buisness level standards for naming conventions with their
interfaces.

I envision a setting in the dimension tab when viewing a published layer
which will map custom dimension names available in the dataset to a user
defined string. This string would be stored in the coverage.xml under the
custom dimension element as an advertised name, perhaps as an example: “
*<publishedName>run</publishedName>*”. When Geoserver then computes the
custom dimension (and here is where I’m not sure it should ultimately be
done) for example, when determining the “dimensionName” (as used in
AbstractDefaultValueSelectonStrategy.java
<https://github.com/geoserver/geoserver/blob/55c4740060eb2b8809ae935a510ac83eeb923313/src/wms/src/main/java/org/geoserver/wms/dimension/AbstractDefaultValueSelectionStrategy.java&gt;\)
Geoserver will first check for the “<publishedName>” element and use it’s
contents henceforth, otherwise default to the custom dimension name as
usual.

Given the way things are configured, maybe you need to do the opposite,
keep the UI you propose, but key dimensions in the metadata map using the
published name, and have in the dimension configuration a "nativeName"
instead. This also matches how layer renaming facilities work, the layer
has the published name, inside ResourceInfo there is a nativeName.

Overall this is a configuration change, so besides resourcing the actual
coding, you'll have to write a GSIP, see
http://docs.geoserver.org/latest/en/developer/policies/gsip.html

The pull request should follow these rules:
https://github.com/geoserver/geoserver/blob/master/CONTRIBUTING.md

About where the computation happens, most of the action happens in methods
around this class:
https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/WMS.java

Hope this helps, if you have any question just ask here :slight_smile:

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.