[postgis-users] ST_Slope

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Apr 2 09:02:36 PDT 2012



> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of JamesH
> Sent: Monday, April 02, 2012 11:12 AM
> To: postgis-users at postgis.refractions.net
> Subject: Re: [postgis-users] ST_Slope
> 
> Ok I'm trying OpenJump as I need to get going with this for my dissertation.
> 
> Now I'm connected to the datastore, I am trying to run the following query:
> 
> SELECT ST_AsBinary(rast), slope
> FROM (SELECT
>         rid, rast,
> ST_Slope(ST_MapAlgebraExpr(ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, 0,
> 0.1, 0.1, 0, 0, 4269), '8BUI'::text, 1, 0), '32BUI', '([rast.x] - 1) *
> 10 + [rast.y]'), 1, '8BUI'::text) slope  FROM
>         nclheights
>         ); AS foo

To display your slope raster in OpenJump:

SELECT ST_AsBinary((gv).geom), (gv).val
FROM (SELECT ST_DumpAsPolygons(ST_Slope(ST_MapAlgebraExpr(ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, 0, 0.1, 0.1, 0, 0, 4269), '8BUI'::text, 1, 0), '32BUI', '([rast.x] - 1) *
10 + [rast.y]'), 1, '8BUI'::text)) gv
      FROM nclheights 
        ) foo

Pierre



More information about the postgis-users mailing list