[mapserver-dev] Undocumented Mapfile COLOR options

Lime, Steve D (MNIT) steve.lime at state.mn.us
Wed Jul 22 15:18:15 PDT 2020


I'll review and get back to you.

-----Original Message-----
From: mapserver-dev [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Seth G
Sent: Wednesday, July 22, 2020 4:45 PM
To: mapserver-dev at lists.osgeo.org
Subject: [mapserver-dev] Undocumented Mapfile COLOR options

This message may be from an external email source.
Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center.

________________________________

Hi all,

Whilst validating various Mapfiles to try and find all valid options I've come across a couple of special values used in msautotest Mapfiles for COLOR - the first is -255 -255 -255 used in classtest1.map [1]

CLASS
    NAME "Text"
    EXPRESSION ([pixel] == 0)
    COLOR -255 -255 -255
END

This value is defined in mapserver.h [2] as follows:

#define MS_TRANSPARENT_COLOR(color) (((color).alpha==0 || (color).red==-255 || (color).green==-255 || (color).blue==-255)?MS_TRUE:MS_FALSE)

So can this be set to make a color transparent? Is it a valid value and if so should this be added somewhere in the docs? There is currently no reference.

The second example is:

BACKGROUNDCOLOR -1 -1 -1

LABEL BACKGROUNDCOLOR was removed in 6.0 [3] but is still present in mapserver\msautotest\misc\sde_utf2.map

One of the Python MapScript tests refers to this value as an "invalid color" that should throw an error [4]

Any details on these 2 COLOR values appreciated,

Seth


[1] https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmapserver%2Fmapserver%2Fblob%2F85e294e8c8ce3c9c455fea0137d4af1ee2feced0%2Fmsautotest%2Fgdal%2Fclasstest1.map%23L33&data=02%7C01%7Csteve.lime%40state.mn.us%7C87803843a85343091bf208d82e88a33d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637310511680323790&sdata=djY1PqL0p77sn6PTN46HpTa2iyw10EKxkNc3EHLGoFo%3D&reserved=0
[2] https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmapserver%2Fmapserver%2Fblob%2F06a076e9d0992f3ace676933ddcde87985feea31%2Fmapserver.h%23L369&data=02%7C01%7Csteve.lime%40state.mn.us%7C87803843a85343091bf208d82e88a33d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637310511680323790&sdata=SO9%2FJTY1XM6X%2FFmNKsrtpI32qAQ%2FGzKMVUtjncLk9PA%3D&reserved=0
[3] https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fmapfile%2Flabel.html%23mapfile-label-backgroundcolor&data=02%7C01%7Csteve.lime%40state.mn.us%7C87803843a85343091bf208d82e88a33d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637310511680323790&sdata=WD8h2IklWjNr6o58LOWbKDD87mptfZiU31DXbzVspzE%3D&reserved=0
[4] https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmapserver%2Fmapserver%2Fblob%2F85e294e8c8ce3c9c455fea0137d4af1ee2feced0%2Fmapscript%2Fpython%2Ftests%2Fcases%2Fcolor_test.py%23L50&data=02%7C01%7Csteve.lime%40state.mn.us%7C87803843a85343091bf208d82e88a33d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637310511680323790&sdata=iaqNkzBuk07janjkTRx1V8hzrK3yFH4Ms6%2FlCNVpOrc%3D&reserved=0

--
web:https://gcc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgeographika.co.uk%2F&data=02%7C01%7Csteve.lime%40state.mn.us%7C87803843a85343091bf208d82e88a33d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637310511680323790&sdata=lXnOhY5gZBj%2FZyu0j%2BFvckVwLaRtCbR7NyMajQmcWvQ%3D&reserved=0
twitter: @geographika
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fmapserver-dev&data=02%7C01%7Csteve.lime%40state.mn.us%7C87803843a85343091bf208d82e88a33d%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637310511680323790&sdata=JZIom4kiVl5HTIo3ruTZ4gFYe%2BloekSNc714mUbzw9c%3D&reserved=0


More information about the mapserver-dev mailing list