[Mapserver-dev] Re: [Gdal-dev] MMS false color from 16-bit unsigned data?

Chris G. Nicholas cgn at globexplorer.com
Fri Nov 21 16:53:11 EST 2003


totally agreed; 8 and 16-bit cached lookups are the only feasible special cases....but this would sure cover a lot of very interesting data....(elevation, temperature, rainfall ...)

Chris

-----Original Message-----
From:	Frank Warmerdam [mailto:warmerdam at pobox.com]
Sent:	Fri 11/21/2003 1:40 PM
To:	gdal-dev at remotesensing.org
Cc:	mapserver-dev
Subject:	[Mapserver-dev] Re: [Gdal-dev] MMS false color from 16-bit unsigned data?
Chris G. Nicholas wrote:
> I see in the MMS Raster HOW-TO "classification" section the note:
> 
> "Some format drivers (ie. GDAL) cast the pixel values to the range 0 to 255 before applying the classification scheme to them"
> 
> What's involved to address this issue; purely tweeks to mapgdal.c?  It would be extremely cool to apply these things on the fly to HDF slices and lossless jpeg2000 grayscales...

Chris,

There is currently various ways of controlling how the data is scaled to
0 to 255, but the problem that the classification isn't being applied till
after the translation is still there.

To answer your question, the solution would all be local to mapgdal.c in
MapServer, but might require significant restructuring.  But the reason
I haven't done anything about this problem is that running a pixel value
through the classification process is relatively expensive.  Too expensive
to apply to on the order of a quarter million pixel values you might have in
a typical 500x500 map view.  So, instead we just apply the classification
scheme 256 times, to each value between 0 and 255 and remember the results.
Much faster.

But of course, as we see here, with 16bit data there would be 64K possible
values.  For floating point data there is no way of doing the tabular approach.

I don't really see what to do to produce acceptable performance for the
general case.  I am cc:ing mapserver-dev since this is really more of a
mapserver issue than a gdal one.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


_______________________________________________
Mapserver-dev mailing list
Mapserver-dev at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-dev







More information about the Gdal-dev mailing list