Skip to content
Browse files

Return the item GML type as a string rather than object

  • Loading branch information...
geographika committed Mar 20, 2019
1 parent e91f174 commit 3e698196a119f733f2697945360bc7cc298bf101
Showing with 13 additions and 12 deletions.
  1. +13 −12 mapscript/swiginc/layer.i
@@ -688,27 +688,28 @@

%feature("autodoc", "3");
%feature("docstring") "Returns the requested item's field definition.
A layer must be open to retrieve an item definition.
A field definition object includes the following properties:
name, type, alias, encode, minOccurs, outputByDefault, precision
template, visible, and width.
The numitems property contains the number of items
%feature("docstring") "Returns the requested item's field type.
A layer must be open to retrieve the item definition.

Pass in the attribute index to retrieve the type. The
layer's numitems property contains the number of items
available, and the first item is index zero."

gmlItemObj *getItemDefinition(int i)
char *getItemType(int i)

char *itemType = NULL;

if (i >= 0 && i < self->numitems) {
gmlItemListObj *item_list;
item_list = msGMLGetItems(self, "G");
gmlItemObj *item = item_list->items + i;
return item;
else {
return NULL;
gmlItemObj *item = item_list->items + i;
itemType = msStrdup(item->type);
msGMLFreeItems(item_list); // destroy the original list

return itemType;


0 comments on commit 3e69819

Please sign in to comment.
You can’t perform that action at this time.