OGR Autostyling and other providers, styling RFC?

Tamas Szekeres szekerest at GMAIL.COM
Mon Nov 19 18:59:30 EST 2007


2007/11/19, Frank Warmerdam <warmerdam at pobox.com>:
> > That would be great but the implementation should be driver independent I think.
>
> I'm not sure I understand what you mean by driver independent.  Currently the
> plugin api defines a LayerGetStyleInfo() function which is called if the
> styleitem is "AUTO".  So by this approach any data provider could implement
> styling specific to their own datasource though in practice the only one using
> this is OGR.
>

We are thinking of STYLEITEM  "myitem" which is just like another item
is definitely out of the scope for the driver.  The driver should just
present this item to mapserver from the data source just like for
LABELITEM without doing anything with that.

1. Mapserver should be aware of this item which should be included in
the WhichItems call.

2. At the mapserver drawing code instead of calling the driver related
msLayerGetAutoStyle (which is dedicated for the STYLEITEM "AUTO"
option) we should use a driver independent function like
msGetOGRStyleInfo which is implemented at a common place (not by the
OGR driver) at a later time we would possibly implement an
msGetSLDStyleInfo for processing another representation of the style
item strings. I'm tending to consider these style processors are
different entities and not related to either the drivers or the
renderers at all. At the mapfile level we should declare somehow which
style processor is actually used.

We could use for example:

STYLEITEM "OGR:myitem"

or

STYLEITEM "myitem"
STYLEPROCESSOR OGR

And so on.

The approach like this is driver independent.


> My current thinking is that using OGR type styling would be the default
> behavior if STYLEITEM is set, and the data provider does not have any
> override for the GetStyleInfo() method.  So ogr support would in a sense
> be driver independent, in that it would be available for all providers that
> don't override with some specific behavior for themselves.  However, it would
> be dependent on the OGR library which is used to parse the style descriptions.
>

I'm not aware of any GetStyleInfo method in the trunk. Did I miss something?

Best regards,

Tamas



More information about the mapserver-dev mailing list