[postgis-users] PostGIS Raster and Overviews

Mikel Gonzalez mgonzalez at cener.com
Mon Jan 28 06:34:53 PST 2013


Hi all!

I'm quite new to PostGIS but I think I'm learning rather quickly. 
Anyways, I have a question regarding the storage of raster data in 
PostGIS. First of all, I think the raster2psql utility is wondrous and 
works great but unfortunately some of the data I need to store as a 
raster comes to me in text format. Let's say I have the 
latitude/longitude values and then the value of the raster in that point 
which in this case, it'll be the swell.

Thing is I've been loading this data to postGIS without any major 
complication and then publishing that same info through geoserver. Let 
me show you how I load the data to PostGIS:

First,

    create table <tableName> (rid SERIAL primary key, rast raster)

Then, for every row of data,

    insert into <tableName> (rast) select
    ST_AddBand(ST_MakeEmptyRaster(1,1,<long>, <lat>,1,1,0,0,4326), 1,
    '32BF', %s, 0.0)

And,

    CREATE INDEX myrasters_rast_st_convexhull_idx ON <tableName> USING
    gist( ST_ConvexHull(rast) );
    SELECT AddRasterConstraints('<tableName>'::name, 'rast'::name);


This is all done in a python script and stores the data (I think) 
correctly. I've got to admit that I still need to understand a little 
bit more some of the parameters that are passed to the AddBand and 
MakeEmptyRaster functions, but I can do it in my own, this is not why 
I'm writing to you. The reason in fact, is that even though GeoServer 
does show the data, it takes quite a lot to load, and I thought it might 
be because I have not defined any overviews. I've been trying to find 
how to do it, but all I see is references to the raster2psql utility, 
but since I'm also a little new with Python I don't know exactly what it 
does.

So, after all this, my question would be how can I add overviews 
"manually" to this raster data I'm loading? I would even appreciate if 
you can tell me where in raster2psql.py I can find it, or if it is in 
any other file it's being used for that purpose.

Thank you very much for reading and I hope I was clear enough about my 
issue :-)

-- 
--

Mikel Gonzalez Gainza,
Informatikari bekaduna CENER-en // Becario informático en CENER
www.cener.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130128/a10e5a87/attachment.html>


More information about the postgis-users mailing list