Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sdlime committed Nov 6, 2019
2 parents 6b94229 + 0fcc810 commit 01af882
Show file tree
Hide file tree
Showing 66 changed files with 1,610 additions and 677 deletions.
13 changes: 9 additions & 4 deletions mapgml.c
Expand Up @@ -1024,14 +1024,14 @@ static void msGMLWriteItem(FILE *stream, gmlItemObj *item,
tag_name = item->name;
if(strchr(tag_name, ':') != NULL) add_namespace = MS_FALSE;

if( item->type && EQUAL(item->type, "Date") ) {
if( item->type && (EQUAL(item->type, "Date") ||
EQUAL(item->type, "DateTime") ||
EQUAL(item->type, "Time")) ) {
struct tm tm;
if( msParseTime(value, &tm) == MS_TRUE ) {
const char* pszStartTag = "";
const char* pszEndTag = "";
int timeresolution;

timeresolution = msTimeGetResolution(value);
encoded_value = (char*) msSmallMalloc(256);
if( outputformat == OWS_GML32 ) {
if( pszFID != NULL )
Expand All @@ -1040,11 +1040,16 @@ static void msGMLWriteItem(FILE *stream, gmlItemObj *item,
pszEndTag = "</gml:timePosition>";
}

if( timeresolution == TIME_RESOLUTION_DAY )
if( EQUAL(item->type, "Date") )
snprintf(encoded_value, 256, "%s%04d-%02d-%02d%s",
pszStartTag,
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
pszEndTag);
else if( EQUAL(item->type, "Time") )
snprintf(encoded_value, 256, "%s%02d:%02d:%02dZ%s",
pszStartTag,
tm.tm_hour, tm.tm_min, tm.tm_sec,
pszEndTag);
else
snprintf(encoded_value, 256, "%s%04d-%02d-%02dT%02d:%02d:%02dZ%s",
pszStartTag,
Expand Down
6 changes: 5 additions & 1 deletion mapmssql2008.c
Expand Up @@ -886,9 +886,13 @@ static int columnName(msODBCconn *conn, int index, char *buffer, int bufferLengt
break;

case SQL_TYPE_DATE:
gml_type = "Date";
break;
case SQL_TYPE_TIME:
gml_type = "Time";
break;
case SQL_TYPE_TIMESTAMP:
gml_type = "Date";
gml_type = "DateTime";
break;

case SQL_BIT:
Expand Down

0 comments on commit 01af882

Please sign in to comment.