Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is it possible to create PostgreSQL views over a table that contains raster data?

I have succeeded in creating the view but the entry in raster_columns is not correct (all the raster info is missing). Also, I couldn't open the SQL view using QGIS (most probably because of the raster_columns not being correct).

It's the same situation as this question on gemetry_columns & views but for the raster column I couldn't find the correct syntax to force the typemod during creation of the view.

All that I could find is this:

raster(ARRAY['8BUI','8BUI','8BUI'], 4326,0.5,-0.5, ...);

but what follows after "..." is a mystery.

Has anybody managed to create a view with correct entries in raster_columns?

A short example will be highly appreciated.

share|improve this question
    
RT_Raster_Overview? postgis.refractions.net/docs/… –  Mapperz Oct 24 '12 at 13:45
    
Raster Overview = a lower resolution caricature of a higher resolution table. I don't need a lower resolution, I need a portion of the big raster at the original quality available as a SQL view. –  asp Oct 24 '12 at 14:32
add comment

1 Answer

Did you create your raster table using raster2pgsql, or specify the -C flag (apply raster constraints) during the load operation? If not, you'll need to apply those constraints with AddRasterConstraints() to ensure that the relevant information about your raster data are registered correctly.

share|improve this answer
1  
The tables were created with raster2pgsql having the -C attribute set: raster2pgsql -I -C -e -Y -F -s 4326 -t 10x10 d:\temp\RasterData\US.tif public.us | %POSTGRESQL_FOLDER%\psql -h localhost -p 5432 -U postgres -d DBTest –  asp Oct 29 '12 at 14:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.