1

I am trying to convert an BNUI 255 greyscale image, with values 10-80 into a colour version using the PostGIS extension(3.4) to Postgres(16.2) using the following code

CREATE TABLE colour_ras AS 
    SELECT ST_Colormap(rast,1,'bluered') as rast
    FROM wind_ras;

The generate raster comes back as coloured version, with some extra holes which seem to set to the NOODATA value. These values match the 10 value in the original raster file.

I have tried different values for the range 10-80, I have tired different values of NODATA, nothing has changed. I know that the transformation between grayscale to colour maps the nodata value correctly because the original raster values are correctly copied.

Grayscale image as seen in Qgis

The colour image is the same size except for the white bits, which are black in the original

Colour image in Qgis

Is there anything obvious that I am doing wrong ?

1 Answer 1

0

I was looking at the image with Qgis, I have just dumped the image by using

gdal_translate -of PNG -outsize 500% 500% "PG:dbname=windproc table=colour_ras " colour.png Which gives the following image, but its flipped at the centre, but there is no dropout in the colours. The source of the problem seems to be the qgis render. Image dumped by gdal_translate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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