Opened 12 years ago

Closed 12 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:


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 by Bborie Park, 12 years ago

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 by Bborie Park, 12 years ago

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 by Bborie Park, 12 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r9940 for trunk.

Note: See TracTickets for help on using tickets.