Database Reference
In-Depth Information
(ST_YMax(ST_Collect(the_geom)) -
ST_YMin(ST_Collect(the_geom))) ))::integer;
Resulting in an on-the-fly raster creation using the following code and we want
to write this to file as an image external to the database, we can. We'll use the
write_file script available at http://postgis.net/docs/manual-2.0/us-
ing_raster.xml.html#RT_PLPython .
WITH tempraster AS (
SELECT ST_AsRaster(
ST_Union(the_geom),
round(500 * (
(ST_XMax(ST_Collect(the_geom)) -
ST_XMin(ST_Collect(the_geom))) /
(ST_YMax(ST_Collect(the_geom)) -
ST_YMin(ST_Collect(the_geom))) ))::integer,
500,
ARRAY['8BUI', '8BUI', '8BUI'],
ARRAY[0,0,0],
ARRAY[0,0,0]) AS rast
FROM
(SELECT *
FROM chp07.uas_voronoi_join) AS uv
),
rasterized AS (
SELECT ST_Union(ST_AsRaster(
the_geom,
rast,
ARRAY['8BUI', '8BUI', '8BUI'],
ARRAY[red, green, blue],
ARRAY[0,0,0]
)
) AS raster
FROM
(
SELECT * FROM
chp07.uas_voronoi_join
Search WWH ::




Custom Search