Opened 5 years ago

Closed 4 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: trunk
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 Changed 5 years ago by strk

Summary: Speed up ST_Envelope[raster] speed up ST_Envelope

comment:2 Changed 5 years ago by Bborie Park

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

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

comment:4 Changed 5 years ago by strk

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

comment:5 Changed 4 years ago by Bborie Park

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

Fixed in trunk as of r12832

comment:6 Changed 4 years ago by strk

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 Changed 4 years ago by Bborie Park

Resolution: fixed
Status: reopenedclosed

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

Note: See TracTickets for help on using tickets.