Skip to content

Commit dd059f5

Browse files
committed
WFS: use correct XSD datatypes in DescribeFeatureType response (#4800)
1 parent 5f1d2b5 commit dd059f5

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

mapwfs.c

+14-1
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,20 @@ static void msWFSWriteItemElement(FILE *stream, gmlItemObj *item, const char *ta
938938
element_name = item->name;
939939

940940
if(item->type)
941-
element_type = item->type;
941+
{
942+
/* Map from MapServer types to XSD types */
943+
if( strcasecmp(item->type,"Integer") == 0 )
944+
element_type = "integer";
945+
else if( EQUAL(item->type,"Real") ||
946+
EQUAL(item->type,"double") /* just in case someone provided the xsd type directly */ )
947+
element_type = "double";
948+
else if( EQUAL(item->type,"Character") )
949+
element_type = "string";
950+
else if( EQUAL(item->type,"Date") )
951+
element_type = "date";
952+
else if( EQUAL(item->type,"Boolean") )
953+
element_type = "boolean";
954+
}
942955

943956
msIO_fprintf(stream, "%s<element name=\"%s\" type=\"%s\"/>\n", tab, element_name, element_type);
944957

msautotest

Submodule msautotest updated from f497f67 to 329d360

0 commit comments

Comments
 (0)