I have imported a raster
into PostGIS, and would like to know the "byte type," ie. if the orignal GeoTIFF was a Byte
type or Int16
.
Is this possible to do after importing to PostGIS? If so, how? Or must it be done on the GeoTIFF file itself?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityUnder your public schema you should have a raster_columns view which serves as a catalogue for all raster columns in your database. One of the columns in the view is pixel_types which lists the pixel type for each band.
If you used the raster2pgsql utility these details should be updated automatically. Otherwise you may have to run the AddRasterConstraints function.
To access via SQL query:
SELECT * FROM raster_columns;
or, for a specific table:
SELECT * FROM raster_columns
WHERE r_table_schema = 'name_of_the_schema_your_table_is_in'
and r_table_name = 'name_of_your_raster_table';
Did you try:
SELECT ST_BandPixelType(rast)
FROM yourrastertable