Opened 12 years ago

Closed 12 years ago

#248 closed defect (fixed)

gml:GridEnvelope upper-corner has minimum value to 0 when subsets are requested

Reported by: Piero Campalani Owned by: Piero Campalani
Priority: major Milestone: 8.4
Component: petascope Version: 8.3
Keywords: gridenvelope high zero Cc: barboni@…
Complexity: Medium

Description (last modified by Piero Campalani)

When making WCS a request with subsets on a coverage the upper-corner (gml:high) of the gml:GridEnvelope in the gml:domainSet of a WCS response trims to 0 the values in case the upper value is negative.

For instance, having a cube with 3rd dimension shifted in its entirety on the negative indexes:

$ rasql -q "select sdom(c) from MODIS_35U AS c" --out string
...
Result element 1: [0:446,0:646,-3:-2]

would return the following GridEnvelope:

<GridEnvelope>
  <low>0 0 -3</low>
  <high>10 20 0</high>
</GridEnvelope>

upon a WCS request with some subset (that hence require to call the setBounds WCS function in wcs2.extensions.AbstractFormatExtension.java).

NOTE: bug discovered by Damiano Barboni (MEEO Srl).

Change History (3)

comment:1 by Piero Campalani, 12 years ago

The problem was in petascope.util.WcsUtil.sdom2bounds() which initialized the array of high grid values to the minimum values available for the Double Java class, which is however meant as the "the smallest positive nonzero value of type double, 2-1074". That value is what is kept and then floored to 0 in the output.

By initializing it to Double.NEGATIVE_INFINITY solves the problem.
Patch is pending.

comment:2 by Piero Campalani, 12 years ago

Description: modified (diff)

comment:3 by Piero Campalani, 12 years ago

Resolution: fixed
Status: newclosed

Bug fixed:

commit d5473041070cbb77a3ec1bea25744bc65556e84d
Author: Piero Campalani <cmppri@unife.it>
Date:   Fri Dec 7 20:30:07 2012 +0100

    Fix GridEnvelope upper-corner in case of negative values (ticket #248).
Note: See TracTickets for help on using tickets.