[mapserver-dev] Built-in/default symbols in MapServer...

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Tue Jan 12 11:20:22 EST 2010


A symbol set MapServer is really a collection of all 3 cases you mention already- one structure. The first symbol is always a default symbol (a pixel), then mapfile-based symbols and finally those from a symbol set (we could actually support multiple symbol files). We'd could change the symbol name-based lookup to traverse the list differently I guess (to reflect your idea). One thing expansion of defaults does is bust defining symbols by number. It works now because user-defined symbols start at index=1. That's not a bad thing, just one side effect...

Anyway, I was thinking that using a naming convention like...

  __ms_symbol_[name]__

might work. You'd have __ms_symbol_circle__, __ms_symbol_square__ and so on. Will have to look at the GDAL docs. In 6.0 we plan to move things like GAP and PATTERN out of symbols and to STYLEs so the number of default symbols is probably pretty small.

I think the other stuff you're talking about might be doable with style-sets. Not sure how it would work but we talked about object references at the last code sprint so that a style for instance could be shared amongst layers. Perhaps they could be grouped some how and referenced by name. Dunno... Schuyler started an RFC on the topic that I need to pick up.

Would also be nice to ship MapServer with different sets of symbols and example styles that mimic MapInfo or ESRI offerings. Or perhaps groups of thematic symbol sets (e.g. geologic symbols, weather symbols, etc...). A great project for non-programmer volunteers.

Steve

________________________________________
From: mapserver-dev-bounces at lists.osgeo.org [mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Tamas Szekeres [szekerest at gmail.com]
Sent: Monday, January 11, 2010 5:22 AM
To: Lime, Steve D (DNR)
Cc: mapserver-dev at lists.osgeo.org
Subject: Re: [mapserver-dev] Built-in/default symbols in MapServer...

2010/1/11 Lime, Steve D (DNR) <Steve.Lime at state.mn.us<mailto:Steve.Lime at state.mn.us>>
Hi all: What would devs think about adding a reasonable set of default symbols to MapServer? They'd just be there to reference by name. It's a
relatively simple change. Just define a static array of symbol defs (e.g. "SYMBOL NAME \"__ms_circle__\" ...) and define a msUpdateSymbolFromString()
function similar to the ones used already in mapfile.c. (this is probably a good idea anyway for use in mapscript). The string parsing makes it easy to
define the defaults. I've got it working locally and it's a nice convenience. Hardest part would be defining which are good defaults and what a good
naming convention would be. If there's interest I can write up a quick RFC...


Hi Steve,

We already have some conventions with regards to the OGR style mappings (for example mapping the marker symbols to a symbol with 'default-marker' as a last resort). I think these names should anyway be defined by default in MapServer. However I'm not sure how the name collisions would be handled in this regard. We should probably override the symbols with the same name by using the following priorities:

1. The symbol defined in the mapfile
2. The symbol defined in the symbolset file
3. The symbol defined my MapServer

Curently this issue is not handled and multiple symbols with the same name can co-exist in the symbolset, however only the first symbol of the same name is actually used during the symbol lookups. This would be annoying for those application which displays a symbol selector window for the user.


We could also consider supporting the default MapInfo symbols (line and area styles), however our symbol definition approach should somewhat be extended to implement all of those (lines and brush patterns). It would be a good solution to support grouping multiple symbols to define a new symbol which would allow to create more complex representations (like combining filled and non filled vectors)


Best regards,

Tamas




More information about the mapserver-dev mailing list