[postgis-devel] [PostGIS] #1141: [raster] ST_AsRaster
PostGIS
trac at osgeo.org
Fri Jul 22 10:27:53 PDT 2011
#1141: [raster] ST_AsRaster
----------------------------+-----------------------------------------------
Reporter: dustymugs | Owner: pracine
Type: task | Status: new
Priority: medium | Milestone: PostGIS 2.0.0
Component: postgis raster | Version: trunk
Keywords: |
----------------------------+-----------------------------------------------
ST_AsRaster provides the ability convert a geometry into a raster. To
create the raster, the X and Y scale or the width and height of the raster
must be provided.
The output raster will be in the same coordinate system as the source
geometry. The only exception is for ST_AsRaster variations with a raster
input parameter.
1. ST_AsRaster(
geom geometry,[[BR]]
scalex double precision, scaley double precision,[[BR]]
pixeltype text[] DEFAULT ARRAY!['8BUI']::text[],[[BR]]
value double precision[] DEFAULT ARRAY![1]::double precision[],[[BR]]
nodataval double precision[] DEFAULT ARRAY![0]::double
precision[],[[BR]]
upperleftx double precision DEFAULT NULL, upperlefty double precision
DEFAULT NULL,[[BR]]
gridx double precision DEFAULT NULL, gridy double precision DEFAULT
NULL,[[BR]]
skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
) -> raster
geom: the geometry to convert to a raster. Can be any valid PostGIS
geometry.
scalex: the scale/pixel size in the X axis of the output raster. If
scalex and scaley are zero (0), the output raster's scale will be
autocomputed.
scaley: the scale/pixel size in the Y axis of the output raster. If
scalex and scaley are zero (0), the output raster's scale will be
autocomputed.
pixeltype: array of pixel types for each band. Each array element is a
band.
value: array of values to burn into the raster for the geometry. Each
array element is a band.
nodataval: array of nodata values to burn into the raster. Each array
element is a band. If an array element is null, that band will not have a
nodata value.
upperleftx: the X value of the upper-left corner of the output raster
upperlefty: the Y value of the upper-left corner of the output raster
gridx: the X coordinate of a point on the grid to which the raster will
be aligned. Value is in the raster's world coordinates.
gridy: the Y coordinate of a point on the grid to which the raster will
be aligned. Value is in the raster's world coordinates.
skewx: the skew along the X axis of the raster. by default, the skew
along the X axis is zero.
skewy: the skew along the Y axis of the raster. by default, the skew
along the X axis is zero.
''If the number of elements for pixeltype, value and nodataval do not
match, the minimum number of elements will be used.''
2. ST_AsRaster(
geom geometry,[[BR]]
width integer, height integer,[[BR]]
pixeltype text[] DEFAULT ARRAY!['8BUI']::text[],[[BR]]
value double precision[] DEFAULT ARRAY![1]::double precision[],[[BR]]
nodataval double precision[] DEFAULT ARRAY![0]::double
precision[],[[BR]]
upperleftx double precision DEFAULT NULL, upperlefty double precision
DEFAULT NULL,[[BR]]
gridx double precision DEFAULT NULL, gridy double precision DEFAULT
NULL,[[BR]]
skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
) -> raster
width: the number of pixels per line in the raster
height: the number of lines in the raster
3. ST_AsRaster(
geom geometry,[[BR]]
scalex double precision, scaley double precision,[[BR]]
pixeltype text,[[BR]]
value double precision DEFAULT 1,[[BR]]
nodataval double precision DEFAULT 0,[[BR]]
upperleftx double precision DEFAULT NULL, upperlefty double precision
DEFAULT NULL,[[BR]]
gridx double precision DEFAULT NULL, gridy double precision DEFAULT
NULL,[[BR]]
skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
) -> raster
Like !#1 but pixeltype, value and nodataval are simple values rather
than arrays. Therefore, the output raster will only have one band.
4. ST_AsRaster(
geom geometry,[[BR]]
width integer, height integer,[[BR]]
pixeltype text,[[BR]]
value double precision DEFAULT 1,[[BR]]
nodataval double precision DEFAULT 0,[[BR]]
upperleftx double precision DEFAULT NULL, upperlefty double precision
DEFAULT NULL,[[BR]]
gridx double precision DEFAULT NULL, gridy double precision DEFAULT
NULL,[[BR]]
skewx double precision DEFAULT 0, skewy double precision DEFAULT 0
) -> raster
5. ST_AsRaster(
geom geometry,[[BR]]
ref raster,[[BR]]
pixeltype text[] DEFAULT ARRAY!['8BUI']::text[],[[BR]]
value double precision[] DEFAULT ARRAY![1]::double precision[],[[BR]]
nodataval double precision[] DEFAULT ARRAY![0]::double precision[]
) -> raster
ref: the reference raster whose scalex, scaley, skewx, skewy and srid
will be applied to the output raster. The upperleft corner of the
reference raster is used to align the output raster to the same grid.
6. ST_AsRaster(
geom geometry,[[BR]]
ref raster,[[BR]]
pixeltype text,[[BR]]
value double precision DEFAULT 1,[[BR]]
nodataval double precision DEFAULT 0
) -> raster
Like !#5 but pixeltype, value and nodataval are simple values rather
than arrays. Therefore, the output raster will only have one band.
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/1141>
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