[postgis-users] raster regions

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Jul 15 10:43:22 PDT 2019


That could translate into something like this in PostGIS:

WITH floodareas AS (
  SELECT ST_MapAlgebra(rast, ‘1BB’, ‘CASE WHEN [rast] < 10 THEN 1 ELSE NULL END’) rast
  FROM elevation
FROM districts d, floodareas f
WHERE ST_Intersects(g.geom, f.rast)

NULL becomes nodata values. You could also use ST_Reclass() instead of ST_Mapalgebra().


De : postgis-users <postgis-users-bounces at lists.osgeo.org> De la part de Joao Cordeiro
Envoyé : 15 juillet 2019 10:19
À : 'PostGIS Users Discussion' <postgis-users at lists.osgeo.org>
Objet : [postgis-users] raster regions

Hi there,

I am not actually a POSTGIS user, or developer, although I am doing some research of integration of vector -raster in a dbms context. My main question s about identifying regions represented in a domain like the "hybrid raster" so that they can be referred to in a query. For example, I would like to write something like "select d from districts where d.geometry touches flooding", where "flooding" indicates an expression intended to decide on the pertinence of locations to a flooding ​​risk area described, for instance through map algebra.

Thanks for any hints or suggestions.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190715/37341b1a/attachment.html>

More information about the postgis-users mailing list