[postgis-devel] [PostGIS] #1141: [raster] ST_AsRaster

PostGIS trac at osgeo.org
Fri Jul 22 15:17:24 PDT 2011


#1141: [raster]  ST_AsRaster
----------------------------+-----------------------------------------------
 Reporter:  dustymugs       |       Owner:  dustymugs    
     Type:  task            |      Status:  assigned     
 Priority:  medium          |   Milestone:  PostGIS 2.0.0
Component:  postgis raster  |     Version:  trunk        
 Keywords:                  |  
----------------------------+-----------------------------------------------

Comment(by dustymugs):

 I agree that having two useless parameters is undesirable.  The way I
 prototyped the function is so that the function can be called as easily as
 possible, which is to provide the geometry and either the scale or
 width/height.

 I've refactored the functions to those below.  I basically moved the gridx
 and gridy parameters up in the list of parameters as I think that it is
 easier to specify a grid point to align to rather than deal with the
 upper-left corner of the raster as the grid point could be gotten from the
 coverage or raster to align with.

 {{{
 1. ST_AsRaster(
         geom geometry,
         scalex double precision, scaley double precision,
         gridx double precision DEFAULT NULL, gridy double precision
 DEFAULT NULL,
         pixeltype text[] DEFAULT ARRAY['8BUI']::text[],
         value double precision[] DEFAULT ARRAY[1]::double precision[],
         nodataval double precision[] DEFAULT ARRAY[0]::double precision[],
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 2. ST_AsRaster(
         geom geometry,
         scalex double precision, scaley double precision,
         pixeltype text[],
         value double precision[] DEFAULT ARRAY[1]::double precision[],
         nodataval double precision[] DEFAULT ARRAY[0]::double precision[],
         upperleftx double precision DEFAULT NULL, upperlefty double
 precision DEFAULT NULL,
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 3. ST_AsRaster(
         geom geometry,
         width integer, height integer,
         gridx double precision DEFAULT NULL, gridy double precision
 DEFAULT NULL,
         pixeltype text[] DEFAULT ARRAY['8BUI']::text[],
         value double precision[] DEFAULT ARRAY[1]::double precision[],
         nodataval double precision[] DEFAULT ARRAY[0]::double precision[],
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 4. ST_AsRaster(
         geom geometry,
         width integer, height integer,
         pixeltype text[],
         value double precision[] DEFAULT ARRAY[1]::double precision[],
         nodataval double precision[] DEFAULT ARRAY[0]::double precision[],
         upperleftx double precision DEFAULT NULL, upperlefty double
 precision DEFAULT NULL,
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 5. ST_AsRaster(
         geom geometry,
         scalex double precision, scaley double precision,
         gridx double precision, gridy double precision,
         pixeltype text,
         value double precision DEFAULT 1,
         nodataval double precision DEFAULT 0,
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 6. ST_AsRaster(
         geom geometry,
         scalex double precision, scaley double precision,
         pixeltype text,
         value double precision DEFAULT 1,
         nodataval double precision DEFAULT 0,
         upperleftx double precision DEFAULT NULL, upperlefty double
 precision DEFAULT NULL,
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 7. ST_AsRaster(
         geom geometry,
         width integer, height integer,
         gridx double precision, gridy double precision,
         pixeltype text,
         value double precision DEFAULT 1,
         nodataval double precision DEFAULT 0,
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 8. ST_AsRaster(
         geom geometry,
         width integer, height integer,
         pixeltype text,
         value double precision DEFAULT 1,
         nodataval double precision DEFAULT 0,
         upperleftx double precision DEFAULT NULL, upperlefty double
 precision DEFAULT NULL,
         skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
 ) -> raster
 }}}

 {{{
 9. ST_AsRaster(
         geom geometry,
         ref raster,
         pixeltype text[] DEFAULT ARRAY['8BUI']::text[],
         value double precision[] DEFAULT ARRAY[1]::double precision[],
         nodataval double precision[] DEFAULT ARRAY[0]::double precision[]
 ) -> raster
 }}}

 {{{
 10. ST_AsRaster(
         geom geometry,
         ref raster,
         pixeltype text,
         value double precision DEFAULT 1,
         nodataval double precision DEFAULT 0
 ) -> raster
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1141#comment:7>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list