WCS 1.0.0 GetCoverage Ignores Elevation and Custom Dimension Parameters

Description

The KvpUtils class in org.geoserver.ows.util parses incoming parameters as an ArrayList of values. The Wcs10GetcoverageRequestReqder in org.geoserver.wcs.kvp performs a check in the checkTypeAxisRange method for the type of the incoming parameter.

The bug occurs because the checkTypeAxisRange method assumes the incoming parameter Object can only be of type String, Integer, or Double. As it is always of type ArrayList no submitted Elevation parameter is ever used and the default elevation is always returned instead.

Environment

None

Activity

Show:
Steve Ikeoka
March 8, 2019, 6:25 PM
Andrea Aime
March 9, 2019, 11:16 AM

for any issue blocking you, you can make a pull request to fix it yourself, contributions are welcomed, or NOAA can sponsor a fix through any commercial support providers:

http://geoserver.org/support/

Quoting the relevant part of the GPL 2.0 license, that GeoServer is distributed with, to put things in the right context:

"THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION."

Checking the entire license could be useful too: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

Shane Mill - NOAA Affiliate
March 13, 2019, 1:14 PM

Thank you both for the feedback, much appreciated! We are still experiencing the issue in wcs 2.0. We can get the default elevation but are unable to retrieve any of the other elevations. We're digging in to this more and will let you know what we find.

Steve Ikeoka
March 18, 2019, 7:23 PM
Edited

Merged on master. Will wait until after 2.14.3 release to backport.

Shane Mill - NOAA Affiliate
April 1, 2019, 3:40 PM

Hey Steve and Andrea,

We've gone through some testing and have pinpointed at least the source of the error.

Just a quick recap, when making a getCoverage request with WCS 2.0.1, the default elevation is returned, but when making a request to a non-default elevation, the following exception is returned:

We've stepped through some of the code. Focusing on DefaultNetCDFEncoder.java located (here there is a writeDataValues method starting at line 325. When you get to line 355, a series of variables are set which are used in a series of for loops starting at line 415. Within these for loops, a setPixel method is called.

setPixel appears to be located in AbstractNetCDFEncoder.java located here.

This begins at line 617. We notice that for the default elevation, this method repeats (within the series of for loops). What seems to be happening is when we make a request that is not the default elevation, the method breaks at line 648:

We find that the exception thrown is the "NullPointerException". In the describe coverage request, the xml shows this structure as Steve described previously:

Let me know if anything comes to mind, or is apparent to you. Thanks again,
Shane

Assignee

Steve Ikeoka

Reporter

David B Marks

Triage

None

Fix versions

Affects versions

Components

Priority

Medium
Configure