Layer Attribute List

Jerry Pisk jerry.pisk at GMAIL.COM
Wed Feb 15 19:14:52 EST 2006


Hi,

I'm working on adding a support for identifiers that need quoting to
the PostGIS layer connector and I was wondering about what the rules
are for the attribute list created during msLayerGetItems. Is that
list allowed to change between the msLayerGetItems call and subsequent
layer calls (such as msLayerWhichShapes and msLayerNextShape)?

The problem I'm running into is that sometimes (map draws) the layer
item collection is populated by code outside the layer and must not be
quoted since it can contain expressions instead of simple column names
(I regularly use upper(column) as my LABELITEM) and sometimes it is
populated by the layer code by calling msLayerGetItems at which point
the PostGIS code simply does a SELECT * FROM <source> and loops
through the returned column names which must be quoted. Unfortunately
I have not found a way to distinguish between these two cases in the
call to msLayerWhichShapes. My current plan is to create a PostGIS
internal array of quoted column names in the call to msLayerGetItems
and have msLayerWhichShapes use that array if present or the attribute
list if not. But that will not work if the attribute collection is
modified after the call to msLayerGetItems.

I would appreciate any input on this, I'm not certain about the inner
workings of mapserver and the rules that apply and assumptions that
can be safely made. Thanks in advance for any response to these
questions and issues, if there is a way to do this safely please let
me know.

Jerry Pisk



More information about the mapserver-dev mailing list