[postgis-users] Postgis raster tutorial

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Apr 21 07:11:47 PDT 2014


There are two strategies to convert a table composed of many geometries to a raster coverage:

1) ST_AsRaster each geometries, ST_Union them and then ST_Tile them.

2) Use ST_ExtractToRaster() from the PostGIS Add-ons.

I plan to blog about this as soon as I get 400 times 5 minutes...

Pierre

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of georgew
> Sent: Thursday, April 17, 2014 7:25 AM
> To: postgis-users at lists.osgeo.org
> Subject: [postgis-users] Postgis raster tutorial
> 
> As a new raster user I have found it extremely difficult to come to grips
> with the task of creating a raster table with postgis, in particular from an
> existing vector table, a task which is really trivial when done with some
> existing s/w packages ( i.e. SAGA, GRASS etc..). Most of the examples I
> could find were based  on the use of raster2pgsql which implies the prior
> existence of a raster file created with an external package, not on using
> postgis native capabilities to create such a raster. If you already have a
> raster file,  postgis has no problem creating a table from it, but what if
> you don't? Should you be forced to use one of the external packages?
> The postgis manual has a total of two (2) examples on how to create a
> raster
> table with st_asraster, although there are ten (10) different variants. My
> point is not a criticism of postgis raster, at the contrary, a suggestion
> that it could be much more useful if properly explained to users not
> familiar with it. In other words a good postgis raster tutorial would go a
> long way to convince users to at least try postgis raster by itself without
> recourse to external packages (except perhaps for the visualisation of the
> rasters). Specifically, how to create with postgis a raster table from a
> vector table, how to extract values from one of the vector attributes and
> store them in the raster, resulting in a raster identical to what would have
> been created with raster2pgsql. I, with my ignorance of the topic, have not
> been able to do that yet.
> If such a tutorial has already appeared somewhere I would be delighted to
> be
> pointed in that direction.
> Many thanks
> 
> 
> 
> 
> --
> View this message in context: http://postgis.17.x6.nabble.com/Postgis-
> raster-tutorial-tp5006124.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list