[mapserver-dev] Option to use type, with, precision information of layer attributes

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Wed Oct 17 13:46:23 PDT 2012

I don’t think this is unreasonable. Might be nice to lookup by name too. Are there other use cases where this might be useful? Ones that come to mind are on the presentation side (templates, labels) and expression handling. Any thoughts about how we might leverage this in those situations?


From: mapserver-dev-bounces at lists.osgeo.org [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Tamas Szekeres
Sent: Thursday, October 11, 2012 4:56 PM
To: mapserver-dev at lists.osgeo.org
Subject: [mapserver-dev] Option to use type, with, precision information of layer attributes

Hi All,

We would like to establish an option to get type, with, precision information from the drivers.
Currently all items are treated as strings and no such information provided by the drivers.

To keep it simple, I would let the drivers manage the item information internally and only a new method would be added to
the layer vtable:

itemDefnObj* (*LayerGetItemDefn)(layerObj *layer, int item);

typedef struct {
    int index;
    int type;
    int width;
    int precision;
  } itemDefnObj;

We can use the following concept to implement and utilize the new method:

1. Drivers may decide whether to implement this method or not. The default implementation would return NULL.
2. Clients should call InitItemInfo before calling LayerGetItemDefn.
2. The drivers may decide whether to store the itemDefnObj structs in layer->iteminfo or continue to use the itemindex array and create itemDefnObj on the fly using the item index (when LayerGetItemDefn is called).
3. In msWFSDescribeFeatureType (mapwfs.c) we would use LayerGetItemDefn to retrieve the item definition and copy the corresponding values to gmlItemObj before reading the metadata values.
4. MapScript API would be extended with a new method added to layerObj.    itemDefnObj *getItemDefn(int i)

Let me know whether this would be reasonable or not.

Implementation would be provided within the scope of this bug:

Best regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20121017/c9bd417f/attachment.html>

More information about the mapserver-dev mailing list