[postgis-users] postgis raster st_value

John Callahan john.callahan at udel.edu
Mon Feb 20 18:46:28 PST 2012


Thank you.  It works great!  The following works for a single point against
a single raster:

SELECT
ST_Value(rast, ST_SetSRID(ST_Point(187251.0, 119422.0), 26957))
FROM geol1
WHERE ST_Intersects(rast, ST_SetSRID(ST_Point(187251.0, 119422.0),
26957)::geometry, 1);


Could anyone recommend the best way to query multiple rasters using the
same point for each?  I've seen examples pulling multiple points from the
same rasters but not the same point from multiple rasters.  I have about
10-20 rasters (geol2, geol3..) I need to find the value of at a single
point.

- John

***********************************************
John Callahan, Research Scientist
Delaware Geological Survey, University of Delaware
URL: http://www.dgs.udel.edu
*************************************************



On Mon, Feb 20, 2012 at 4:29 PM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca>wrote:

> Use ST_Intersects(raster, geometry) in the WHERE clause (as you would do
> with geometries).
>
> Pierre
>
> > -----Original Message-----
> > From: postgis-users-bounces at postgis.refractions.net [mailto:
> postgis-users-
> > bounces at postgis.refractions.net] On Behalf Of John Callahan
> > Sent: Monday, February 20, 2012 4:28 PM
> > To: PostGIS Users Discussion
> > Subject: [postgis-users] postgis raster st_value
> >
> > Hopefully this is a question with a quick answer....
> >
> > I have a few rasters loaded into PostGIS 2.0 alpha5.  I loaded them with
> tiles at
> > 256x256 px (no real reason why I chose those dimensions.)  When I run a
> simple
> > ST_Value() statement, returned is one record for each tile.  And, of
> course, every
> > one of those will be blank except for the tile that contains the
> location.  Is there
> > a way to return only the value, and not a full array of nearly empty
> cells?   (of
> > course, only one value is returned when the raster is not-tiled but I'm
> not sure if
> > that's the way to go.)  Thanks.
> >
> >
> > - John
> >
> > ***********************************************
> > John Callahan, Research Scientist
> > Delaware Geological Survey, University of Delaware
> > URL: http://www.dgs.udel.edu
> > *************************************************
> >
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120220/687e551f/attachment.html>


More information about the postgis-users mailing list