[postgis-devel] [wktraster] Core tests failure for r5841

Mateusz Loskot mateusz at loskot.net
Thu Jan 13 05:33:02 PST 2011


On 13/01/11 09:08, strk wrote:
> On Thu, Jan 13, 2011 at 01:12:58AM +0000, Mateusz Loskot wrote:
>
>> "Something must have gone wrong on Mat`s one" means either GCC team has
>> screwed their compiler and it generates rubbish, or we have problem in
>> PostGIS. Which one you vote for?
>
> Hey...
> We're talking about a message of this form:
>
>   WARNING:  Initial pixel value for 16BSI band got truncated from XXX to YYY
>
> Sounds like the problem isn't going unnoticed, which is good.

Yes, the warning is good.

> That's all that test is checking: if numbers that don't fit in 16BSI
> representation are correctly WARNED about.

Not really, the warning is killed to make us happy all tests pass.
This is wrong.

> I vote for "a problem with testing framework" :)

IMO, the problem is on both sides of the bridge.
The values clamping implementation is not portable, not robust
and not numerically stable.

Once the truncation rules are defined for integral types, it should be
not a problem to implement them. For instance, what choices we have to 
cope with -32769 value for 16BSI?
- cast to int16_t and document result as undefined
- truncate towards Zero by storing SHRT_MIN (SHRT_MAX for positive)
- wrap around
- store NODATA value
- ...

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org



More information about the postgis-devel mailing list