Hi,

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
)
SELECT d.*
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().

Pierre

De : postgis-users <[email protected]> De la part de Joao 
Cordeiro
Envoyé : 15 juillet 2019 10:19
À : 'PostGIS Users Discussion' <[email protected]>
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.

Att.
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to