Opened 5 years ago

Closed 5 years ago

#248 closed defect (fixed)

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

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

Description (last modified by pcampalani)

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:

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

upon a WCS request with some subset (that hence require to call the setBounds WCS function in

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

Change History (3)

comment:1 Changed 5 years ago by pcampalani

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 Changed 5 years ago by pcampalani

  • Description modified (diff)

comment:3 Changed 5 years ago by pcampalani

  • Resolution set to fixed
  • Status changed from new to closed

Bug fixed:

commit d5473041070cbb77a3ec1bea25744bc65556e84d
Author: Piero Campalani <>
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.