Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1281 closed enhancement (fixed)

[raster] ST_MapAlgebraFct for two rasters

Reported by: Bborie Park Owned by: Bborie Park
Priority: blocker Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: history Cc:

Description

The sibling to 2-raster ST_MapAlgebraExpr. Instead of a set of expressions, use a function call.

  1. st_mapalgebrafct(

rast1 raster, band1 integer, rast2 raster, band2 integer, userfunction regprocedure, pixeltype text DEFAULT NULL, extenttype text DEFAULT 'INTERSECTION', VARIADIC userargs text[] DEFAULT NULL

  1. st_mapalgebrafct(

rast1 raster, rast2 raster, userfunction regprocedure, pixeltype text DEFAULT NULL, extenttype text DEFAULT 'INTERSECTION', VARIADIC userargs text[] DEFAULT NULL

)

  1. st_mapalgebrafct(

rast1 raster, rast2 raster, userfunction regprocedure, VARIADIC userargs text[]

)

It'll be interesting to compare performance between this function and ST_MapAlgebraExpr.

Change History (7)

comment:1 by Bborie Park, 13 years ago

Component: postgispostgis raster
Status: newassigned

comment:2 by pracine, 13 years ago

I guess performance will be comparable only if you PREPARE the query parsing the expression in ST_MapAlgebraExpr. I did some test with the one raster version (which was not PREPARING the query at the moment) and ST_MapAlgebraFct was 7 time ST_MapAlgebraExpr for the same expression.

comment:3 by Bborie Park, 13 years ago

I'm suspecting that 2-raster ST_MapAlgebraFct will still be faster than 2-raster ST_MapAlgebraExpr. I'll be committing the code shortly. Development went quickly as both ST_MapAlgebraExpr and ST_MapAlgebraFct call the same underlying function, RASTER_mapAlgebra2.

comment:4 by pracine, 13 years ago

Are you PREPARING the query in ST_MapAlgebraExpr?

comment:5 by Bborie Park, 13 years ago

That's just my hunch as to the performance. I've yet to compare the two as I'm just finishing up regression testing and valgrinding. All expressions are prepared in 2-raster ST_MapAlgebraExpr unless the expression has no parameters (which would cause the process to crash).

comment:6 by Bborie Park, 13 years ago

Resolution: fixed
Status: assignedclosed

comment:7 by Bborie Park, 13 years ago

Keywords: history added
Note: See TracTickets for help on using tickets.