[postgis-devel] Regular expressions in PostGIS sources

Jorge Arévalo jorge.arevalo at deimos-space.com
Mon Nov 15 15:17:02 PST 2010


On Mon, Nov 15, 2010 at 9:46 PM, Kevin Neufeld <kneufeld at refractions.net> wrote:
> On 11/15/2010 12:29 PM, Jorge Arévalo wrote:
>>
>> For MapAlgebra implementation at core level. The ST_MapAlgebra
>> Pl/pgSQL function takes an input argument like "SELECT rast + 3",
>> meaning "add 3 to all raster's pixels", and it calls a  core function
>> (via postgresql function) to perform the operation.
>>
>> Should I parse the expression in PL/pgSQL function, at postgresql
>> level or at core level? Now, I'm working only at core level.
>
> I may be out here, but wouldn't you rather define the + operator for
> raster/integer?
> -- Kevin
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>

You mean define '+' in the same sense operators like '&&' or '~' are
defined for vectors? Would be a smart way, yes.

Just now we have a PL/pgSQL implementation of MapAlgebra, that uses
'replace' string function to replace the word 'rast' for a given value
in expressions like 'select rast + 20' and then run EXECUTE expr
INTO... statement
(http://svn.osgeo.org/postgis/trunk/raster/scripts/plpgsql/st_mapalgebra.sql).
But for a C implementation of MapAlgebra, I guess we should explore
different ways. Defining a new operator seems to be a good idea.

Many thanks!
-- 
Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge.arevalo at deimos-space.com
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com



More information about the postgis-devel mailing list