[mapserver-users] color range fade to transparent.

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Tue Jun 2 15:33:43 PDT 2015


All,

My solution below turned out to not be correct either.  It just ramps down from RED to the color WHITE, no transparency.

Here is the layer block I’m using that I’m trying to fade to a transparent feature:

MAP

TRANSPARENT true
IMAGECOLOR 254 254 254

<more stuff>

        LAYER
                METADATA
                 "ows_title" "bbox"
                 "gml_include_items" "all"
                END
GROUP 'users'
                NAME 'bbox'
                STATUS ON
                TYPE LINE


<DB connections stuff>


## the following greabs a 5 min chunk of data (BBOX geoms  from the database from 28 hrs ago and assigns a seq and elapsed time column to the result.
                DATA "bbox from (

                        SELECT
row_number() over (order by accessed_at nulls last) as seq,
date_part('epoch', (now() - INTERVAL '28 hours' - accessed_at)::interval) as elapsed,
id, accessed_at, bbox
                        FROM
                                layer_metrics
                        Where
                                accessed_at < (NOW() - INTERVAL '28 hours')
AND
                                accessed_at >= (NOW() - INTERVAL '28 hours' - INTERVAL '5 minute')

                                         ) as subquery using unique id using srid=200068"

                LABELITEM "elapsed"

CLASS
                        #NAME "5 Minute Trail"
EXPRESSION ([elapsed] >= 0 AND [elapsed] < 300) ## 0-5min
STYLE
                                OUTLINECOLOR 0 0 0
                                OUTLINEWIDTH 1
                                #COLOR 0 255 0
COLORRANGE 255 0 0 254 254 254 ##red to opaque (see IMAGECOLOR in the MAP block above)
DATARANGE 0 300
RANGEITEM "elapsed"

END
END
END
END


bobb



On Jun 2, 2015, at 4:27 PM, Ben Madin <ben at ausvet.com.au<mailto:ben at ausvet.com.au>> wrote:

Bob,

Nice, I never knew that such a colorrange option existed (at least, I couldn’t find it documented anywhere?) but I would have presumed maybe you could specify the colour using the alpha like any other colour?

COLORRANGE 255 0 0 255 255 255 255  0 ## red -> transparent



Alternatively, if you had a common background colour, you could fade to that?

cheers

Ben



On 2015-06-03, at 04:48 , Basques, Bob (CI-StPaul) <bob.basques at ci.stpaul.mn.us<mailto:bob.basques at ci.stpaul.mn.us>> wrote:

All,

Anyone know how to use a transparent color on one end of the coloring option?

COLORRANGE 255 0 0 ??? ??? ??? ## red -> transparent

It there a RGB color to use for Transparency to fade to?  I basically want to fade a line based on age to nothing.

Thanks

bobb



_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users


--

Ben Madin

t : +61 8 6102 5535
m : +61 448 887 220
e : ben at ausvet.com.au<mailto:ben at ausvet.com.au>

AusVet Animal Health Services
Western Australia

AusVet's website:  http://www.ausvet.com.au

This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender. The contents of this email are the opinion of the writer only and are not endorsed by AusVet Animal Health Services unless expressly stated otherwise. Although AusVet uses virus scanning software we do not accept liability for viruses or similar in any attachments. Thanks for reading.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150602/27914c3a/attachment.html>


More information about the mapserver-users mailing list