[postgis-users] Retrieving Data from PostGIS Raster usingST_Value

Paragon Corporation lr at pcorp.us
Wed Oct 12 14:44:14 PDT 2011


Elliot,

Why are you computing this for every pixel.  You should be using
ST_Intersects geometry/raster for that.  That is the beauty of postgis
raster is that you can do a spatial query between the 2.  

Like I mentioned in other post in response to Bryce, the performance hit in
plpgsql is the memory copy of the raster tile for each call.
If you want all, you should be using ST_Intersection or ST_DumpPolygons. 

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of elliott
> Sent: Wednesday, October 12, 2011 3:28 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Retrieving Data from PostGIS 
> Raster usingST_Value
> 
> It is just one SRTM3 tile which is 1201 x 1201.  The data is 
> used by scientific codes to determine the elevation at a 
> given latitude and longitude.
> 
> On 10/12/2011 2:35 PM, Nordgren, Bryce wrote:
> > I'd be interested to know the size of the raster tile 
> (width x height) which took 1/2 hour to retrieve all the info.
> >
> > On the other hand, the usage paradigm for raster is to use 
> the utility functions, because this is what is fast. Plpgsql 
> is not compiled, so it'll be slow to iterate over all the 
> pixels. What are you trying to do with the data once you get 
> it? Can you accomplish the same thing by making an 
> "expression" and using ST_MapAlgebra?
> >
> > Bryce
> >
> > -----Original Message-----
> > From: postgis-users-bounces at postgis.refractions.net 
> > [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of 
> > elliott
> > Sent: Wednesday, October 12, 2011 2:05 PM
> > To: PostGIS Users Discussion
> > Subject: [postgis-users] Retrieving Data from PostGIS Raster using 
> > ST_Value
> >
> > Hello Everyone,
> >
> > I am very new to using PostGIS Raster.  I need to retrieve 
> data fields from a tile loaded into the database.  Using 
> ST_Height and ST_Width, I get the number of rows and columns 
> and iterate over these using the ST_Value to retrieve the 
> data.  This is extremely slow taking 1/2 hour to get all of 
> the data required.  Is there a faster way to accomplish this?
> >
> > Thanks!
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> >    
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 





More information about the postgis-users mailing list