[postgis-users] raster regions

joao.cordeiro at inpe.br joao.cordeiro at inpe.br
Mon Jul 15 11:40:27 PDT 2019


 

Thanks, Pierre, 

It seems ok to model the query the way you showed,
however, that implies the generation of an entire intermediate binary
raster, just to identify the region inside the whole mapped area. My
issue is on avoiding such intermediate data by incorporating map algebra
expression into the same query expression, Another example, ""... d.geom
touch (ndvi2018 < ndvi2019)" where ndvixxxx are raster data. 

Att. 

Em
15-07-2019 14:43, Pierre Racine escreveu: 

> 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
<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. 
> 
> Att. 
> 
>
_______________________________________________
> postgis-users mailing
list
> postgis-users at lists.osgeo.org
>
https://lists.osgeo.org/mailman/listinfo/postgis-users [1]




Links:
------
[1]
https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190715/aa6934bb/attachment.html>


More information about the postgis-users mailing list