classification doesn't work with floating points
Steven M. Ottens
steven.ottens at GEODAN.NL
Thu Apr 26 02:50:12 PDT 2007
Hi all,
I'm working on a dynamic classification application which works with
SLD. I select a bounding box and Mapserver generates a new SLD with the
minimum and maximum values and a range of classes between. This works
fine and the SLD is correct with all the expected classes. However if I
use that SLD to generate a new map I only see 3 colours instead of the
expected 50.
After some investigation I discovered that it was due to the very small
classes I get:
<ColorMapEntry color="#0c317c" quantity="-6.75" />
<ColorMapEntry color="#0f377c" quantity="-6.54" />
<ColorMapEntry color="#0f407e" quantity="-6.47" />
<ColorMapEntry color="#11497f" quantity="-6.40" />
<ColorMapEntry color="#12527f" quantity="-6.36" />
<ColorMapEntry color="#145a81" quantity="-6.32" />
<ColorMapEntry color="#166482" quantity="-6.29" />
<ColorMapEntry color="#186c83" quantity="-6.27" />
<ColorMapEntry color="#1a7584" quantity="-6.25" />
<ColorMapEntry color="#1c7e85" quantity="-6.24" />
<ColorMapEntry color="#1d8786" quantity="-6.23" />
<ColorMapEntry color="#1f9087" quantity="-6.22" />
<ColorMapEntry color="#219888" quantity="-6.21" />
<ColorMapEntry color="#239e89" quantity="-6.20" />
<ColorMapEntry color="#26a380" quantity="-6.19" />
<ColorMapEntry color="#2caa74" quantity="-6.18" />
<ColorMapEntry color="#31b068" quantity="-6.17" />
<ColorMapEntry color="#36b75c" quantity="-6.16" />
<ColorMapEntry color="#3cbe50" quantity="-6.15" />
<ColorMapEntry color="#42c444" quantity="-6.14" />
<ColorMapEntry color="#48cb38" quantity="-6.13" />
<ColorMapEntry color="#4dd12c" quantity="-6.12" />
<ColorMapEntry color="#53d81f" quantity="-6.11" />
<ColorMapEntry color="#58de14" quantity="-6.10" />
<ColorMapEntry color="#5ee508" quantity="-6.09" />
<ColorMapEntry color="#61e901" quantity="-6.08" />
<ColorMapEntry color="#72ea01" quantity="-6.07" />
<ColorMapEntry color="#8bed02" quantity="-6.06" />
<ColorMapEntry color="#a2f002" quantity="-6.05" />
<ColorMapEntry color="#b9f102" quantity="-6.04" />
<ColorMapEntry color="#d1f402" quantity="-6.02" />
<ColorMapEntry color="#e9f602" quantity="-6.01" />
<ColorMapEntry color="#fcf803" quantity="-5.99" />
<ColorMapEntry color="#faf105" quantity="-5.97" />
<ColorMapEntry color="#f6e808" quantity="-5.94" />
<ColorMapEntry color="#f3de0c" quantity="-5.90" />
<ColorMapEntry color="#f0d50f" quantity="-5.85" />
<ColorMapEntry color="#eccc13" quantity="-5.75" />
<ColorMapEntry color="#e9c316" quantity="-5.63" />
<ColorMapEntry color="#000000" quantity="-5.52" />
<ColorMapEntry color="#e2b01c" quantity="-5.35" />
<ColorMapEntry color="#ff1b1b" quantity="-5.00" />
<ColorMapEntry color="#ffa720" quantity="350.00" />
If the classes are without floats there's no problem and mapserver works
as expected.
Some more investigation showed that the 3 colours I see are the ones from:
<ColorMapEntry color="#0f377c" quantity="-6.54" />
<ColorMapEntry color="#000000" quantity="-5.52" />
<ColorMapEntry color="#ff1b1b" quantity="-5.00" />
The last being the class everything bigger then -5.
It's striking that the other two are both around the .5, which does make
me believe there's something wrong with the floating point handling of
mapserver with regard of drawing maps. Is there a setting in my mapfile
which I have to set to make sure it will use all decimals to do the
rendering?
I've attached the map file of this particular layer. In there you see
multiple layers with the same classification, each is an aggregation of
the previous one and kicks in at a different scale level. The whole
thing is a detailed DEM of the Netherlands.
Regards,
Steven
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hoogte.map
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070426/25cc22ff/attachment.ksh>
More information about the MapServer-users
mailing list