[postgis-users] raster output

Paragon Corporation lr at pcorp.us
Wed Dec 21 13:54:03 PST 2011


Forgot to add if you want to output a whole table or a set of records as a
single raster, you'll want to also use the ST_Union function.

 So something like

SELECT ST_AddBand(ST_Reclass(ST_Union(rast) ....)
FROM yourtable
WHERE ST_Intersects(rast,somegeometry)


http://www.postgis.org/documentation/manual-svn/RT_ST_Union.html



> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of Paragon Corporation
> Sent: Wednesday, December 21, 2011 4:03 PM
> To: 'PostGIS Users Discussion'
> Subject: Re: [postgis-users] raster output
> 
> Steve,
> 
> Actually that was just for coloring geometries.  For raster I 
> usually just output the raster as RGB
> 
> R for band 1, G band 2, B for band 3
> 
> If you have a single band raster, you'll need to do 
> reclassify the bands if you want to out as PNG for example
> 
> http://www.postgis.org/documentation/manual-svn/RT_ST_Reclass.html 
> 
> Look at the last example in the docs.
> 
> Or you could just export as one of the gdal 1 Banded 
> supporting formats and use QGIS to do the classification.
> 
> > -----Original Message-----
> > From: postgis-users-bounces at postgis.refractions.net
> > [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of 
> > Stephen Crawford
> > Sent: Wednesday, December 21, 2011 10:51 AM
> > To: PostGIS Users Discussion
> > Subject: Re: [postgis-users] raster output
> > 
> > Thanks for getting back to me.  I want to do something like 
> #3, but I 
> > just don't understand the work flow.  I have raw data as a one band 
> > raster in postGIS, and the (seemingly) simple thing i would 
> like to do 
> > is output the entire table as a  jpg or png with the cells 
> classified 
> > by color.  I see references to "color tables" and 
> "palettes".  I can't 
> > seem to figure out where I can define "if cell val < 0.5, 
> color = 0, 
> > 0, 255" etc.
> > 
> > Thanks,
> > Steve
> > 
> > On 12/20/2011 6:13 PM, Paragon Corporation wrote:
> > > 3) You can use gdal_translate (compiled with PostgreSQL 
> support) to 
> > > output a postgis raster query.
> > 
> > --
> > Stephen Crawford
> > Center for Environmental Informatics
> > The Pennsylvania State University
> > 
> > 
> > 
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> > 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 





More information about the postgis-users mailing list