Opened 6 years ago

Closed 6 years ago

#1872 closed defect (fixed)

[raster] ST_ApproxSummaryStat fails under some condition

Reported by: pracine Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.0.1
Component: raster Version: 2.0.x
Keywords: history Cc:

Description

This works:

SELECT ST_ApproxSummaryStats(ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, 0, 1, 1, 0, 0, 4326), '16BSI'::text, 0, 0));

but if I clip the raster:

SELECT ST_ApproxSummaryStats(ST_Clip(ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, 0, 1, 1, 0, 0, 4326), '16BSI'::text, 0, 0), ST_MakeEnvelope(0, 0, 10, 5, 4326)), 1, true, 0.1);

it fails with this message:

ERROR: floating-point exception DETAIL: An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero. CONTEXT: SQL function "st_approxsummarystats" statement 1

Change History (3)

comment:1 Changed 6 years ago by Bborie Park

Milestone: PostGIS 2.0.2PostGIS 2.0.1
Owner: changed from pracine to Bborie Park
Status: newassigned

Confirmed. I'm on it. Strange that ST_ApproxSummaryStats fails while ST_SummaryStats works.

comment:2 Changed 6 years ago by Bborie Park

Keywords: history added

The error occurs because of an unexpected division by zero. Fixed for 2.0 in r9922. Need to fix in trunk

comment:3 Changed 6 years ago by Bborie Park

Resolution: fixed
Status: assignedclosed

Fixed in r9940 for trunk.

Note: See TracTickets for help on using tickets.