Great, this is just what I needed! Thank you very much ;) Here I leave the function I made in case anyone was interested in it: -- View this message in context: http://postgis.17.n6.nabble.com/Problem-using-ST-MapAlgebraExpr-tp4514561p4521676.html Sent from the PostGIS - User mailing list archive at Nabble.com.