[mapserver-dev] Option to use type, with, precision information of layer attributes
Tamas Szekeres
szekerest at gmail.com
Thu Oct 11 14:56:17 PDT 2012
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:
http://trac.osgeo.org/mapserver/ticket/462
Best regards,
Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20121011/063c6780/attachment.html>
More information about the mapserver-dev
mailing list