[mapserver-users] NULLVALUE for mapscript.MS_IMAGEMODE_RGB and PostGIS 2.1

Pasithee Jupiter pasithee at gmail.com
Tue Nov 19 23:03:58 PST 2013


Hi all

I'm using Postgresql 9.3 and PostGIS 2.1. I have uploaded all my files
using raster2pgsql as follow:
/usr/lib/postgresql/9.3/bin/raster2pgsql -a -f {column!s} -s {srs:d} -N
{nodata:f} -q -F -M {file!s} public.{table!s} | psql -h {host!s} -p
{port:d} -d {database!s} -U {username!s}

When I try to use MapServer to generate a WMS layer all my NULL values are
interpreted as 0 which is not the nodata value I have set using the -N flag
in the raster2pgsql script.

Checking it in the database using ST_DumpValues(rast, 1, true) it will
replace all NULL values with the correct nodata value.

Also setting the NODATA= in the map file is not working.

When I use AAGRID instead and configuring a output format it works (see
here http://mapserver.org/mapfile/outputformat.html):

  OUTPUTFORMAT
    NAME "mytest"
    DRIVER "GDAL/AAIGRID"
    IMAGEMODE INT16
    TRANSPARENT FALSE
    FORMATOPTION "NULLVALUE=65535"
  END # OUTPUTFORMAT


Is that a bug in MapServer when using image mode RGB or RGBA?
Does someone has a solution how to fix it?

Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20131120/4a0b9077/attachment.html>


More information about the mapserver-users mailing list