[postgis-users] ST_Value from Polygon

Paragon Corporation lr at pcorp.us
Tue Feb 22 17:52:19 PST 2011


Have you looked at ST_Intersection.  I'm not sure how large your grids are
so might still be a bit too slow.  
 
 
http://www.postgis.org/documentation/manual-svn/RT_ST_Intersection.html
 
Below is a link to our slides from our North Carolina GIS meeting that may
answer some of your questions (shows some Raster examples) as well as the 3D
ones people have asked.
 
http://www.postgis.us/presentations
 
Hope that helps,
Regina and Leo

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Andreas
Forø Tollefsen
Sent: Tuesday, February 22, 2011 4:28 AM
To: PostGIS Users Discussion
Subject: [postgis-users] ST_Value from Polygon


Hi all, 

I am working with a large raster dataset that i want to aggregate into
vector grids.
The raster dataset is a landcover dataset, and i want to find which of the
raster values are the most dominant within each of the vector grid cells.

I have been looking at the ST_Value function, but this is not usable
together with the cell polygon.

I have written a script that gives me the raster value of the centroid of
each cell, but i want to find which raster class is the largest.
Hence i need to calculate the area of each raster class within each cell and
select the largest class.

Any idea? So far i have only come this far:

DROP TABLE IF EXISTS globshortpoly;
SELECT priogrid_land.cell, ST_Value(rast, ST_Centroid(cell))
INTO globshortpoly
FROM priogrid_land, globshort
WHERE rast && priogrid_land.cell 
LIMIT 1000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110222/d64852ce/attachment.html>


More information about the postgis-users mailing list