[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] Extracting cell values into a matrix
From:       Pierre Racine <Pierre.Racine () sbf ! ulaval ! ca>
Date:       2012-06-29 19:46:29
Message-ID: 87A96661E65C5541AB4D20721C2DD7F8CFBB620558 () EXCH-MBX-A ! ulaval ! ca
[Download RAW message or body]

> Hi, I need to develop a tool that is able to connect with PostGIS and extract
> the cell values from a raster stored in it creating a matrix with them. It
> could be done with queries launched from that tool, using ST_Value(), for
> each cell, but the number of queries would be huge.

You would better be creating a polygon encompassing the pixels you want and ST_Clip \
the raster to this polygon and then get all the values with \
(ST_PixelAsPolygons()).val,  (ST_PixelAsPolygons()).x, (ST_PixelAsPolygons()).y

But could you explain what you intent to do with the values of the matrix? Maybe \
there is a simpler way to do it in SQL...

Maybe just adding a parameter to ST_Neighborhood stating that the neighbourhood \
should be a square instead of a circle would also do what you want. Bborie?

Pierre
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic