[mapserver-users] colorramp and datarange on the fly?

Jan Hartmann j.l.h.hartmann at uva.nl
Wed Feb 3 09:27:48 EST 2010


Hi Bart,

Not sure if this is what you mean, but you can always compute a variable 
with the range you want. The following is inefficient, and not really 
dead easy, but it works.

Say, in your PostGIS table "tbl", your want to display the column "val" 
in 10 colors, with "[minx],[miny],[maxx],[maxy]" as the current extent 
values (e.g. from a template) and "mysrid" as the srid:

LABELITEM labelval

select round ( ((val::float - min) / (max - min)) * 10) as labelval
from (
            select min(val) as min,max(val) as max
            from  tbl
            where the_geom && st_setsrid('BOX3D(' || [minx] || ' ' || 
[miny] || ',' || [maxx] || ' ' || [maxy] || ')'::box3d,mysrid)
) as foo1
,      (
          select val from tbl
) as foo2
;

Jan

On 3-2-2010 14:14, Bart van den Eijnden wrote:
> Hi Jan,
>
> can you elaborate on this approach? Using WKTRaster?
>
> Best regards,
> Bart
>
> On Feb 3, 2010, at 2:11 PM, Jan Hartmann wrote:
>
>    
>> Would be dead easy with postGIS ...
>>
>> Jan
>>
>> On 3-2-2010 12:12, Bart van den Eijnden wrote:
>>      
>>> Hi list,
>>>
>>> is it possible to have a colorramp in Mapserver based on the min and max value in the current extent?
>>>
>>> So instead of predefining the min and max in DATARANGE, have Mapserver use the min and max value of the dataset in the current extent?
>>>
>>> If not, would it be an easy change or a very complex one?
>>>
>>> Best regards,
>>> Bart_______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>
>>>        
>>      
>    


More information about the mapserver-users mailing list