Opened 10 years ago

Closed 10 years ago

#2828 closed enhancement (fixed)

[raster] speed up ST_Envelope

Reported by: strk Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.2.0
Component: raster Version: master
Keywords: history Cc:

Description

I noticed that ST_Envelope(rast) is implemented as ST_Envelope(ST_ConvexHull(rast)).

I'm not sure if that's necessary. Ideally ST_Envelope should be able to give a response by only looking at the raster header, without even fully detoasting the raster.

See #2822

Change History (7)

comment:1 by strk, 10 years ago

Summary: Speed up ST_Envelope[raster] speed up ST_Envelope

comment:2 by Bborie Park, 10 years ago

Status: newassigned

ST_ConvexHull() is only detoasting the header. But the issue is that convexhull generates a geometry to generate a envelope geometry, an unnecessary step.

comment:3 by robe, 10 years ago

don't have the code in front of me but I recall the actual case rast::geometry implemented with ST_ConvexHull(rast)?

comment:4 by strk, 10 years ago

Yes, the cast to geometry is implemented as ST_ConvexHull(rast)

comment:5 by Bborie Park, 10 years ago

Keywords: history added
Milestone: PostGIS 2.2.0
Resolution: fixed
Status: assignedclosed
Version: 2.1.xtrunk

Fixed in trunk as of r12832

comment:6 by strk, 10 years ago

Resolution: fixed
Status: closedreopened

Did you forget to add a test for rt_envelope ? r12832 adds a reference to such test in raster/test/regress/Makefile.in but there's no such new test file.

comment:7 by Bborie Park, 10 years ago

Resolution: fixed
Status: reopenedclosed

Oops. Forgot to add the files to git. Fixed as of r12859

Note: See TracTickets for help on using tickets.