Skip to content

Commit

Permalink
Fix build with WITH_SOS/WFS/WCS/WMS/CLIENT_WMS/CLIENT_WFS=OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 4, 2020
1 parent 42bd44c commit b70464e
Show file tree
Hide file tree
Showing 6 changed files with 304 additions and 301 deletions.
124 changes: 62 additions & 62 deletions mapgml.c
Expand Up @@ -1250,6 +1250,68 @@ static void msGMLWriteConstant(FILE *stream, gmlConstantObj *constant, const cha
return;
}

static void msGMLWriteGroup(FILE *stream,
gmlGroupObj *group, shapeObj *shape,
gmlItemListObj *itemList,
gmlConstantListObj *constantList,
const char *namespace, const char *tab,
OWSGMLVersion outputformat,
const char *pszFID)
{
int i,j;
int add_namespace = MS_TRUE;
char *itemtab;

gmlItemObj *item=NULL;
gmlConstantObj *constant=NULL;

if(!stream || !group) return;

/* setup the item/constant tab */
itemtab = (char *) msSmallMalloc(sizeof(char)*strlen(tab)+3);

sprintf(itemtab, "%s ", tab);

if(!namespace || strchr(group->name, ':') != NULL) add_namespace = MS_FALSE;

/* start the group */
if(add_namespace == MS_TRUE)
msIO_fprintf(stream, "%s<%s:%s>\n", tab, namespace, group->name);
else
msIO_fprintf(stream, "%s<%s>\n", tab, group->name);

/* now the items/constants in the group */
for(i=0; i<group->numitems; i++) {
for(j=0; j<constantList->numconstants; j++) {
constant = &(constantList->constants[j]);
if(strcasecmp(constant->name, group->items[i]) == 0) {
msGMLWriteConstant(stream, constant, namespace, itemtab);
break;
}
}
if(j != constantList->numconstants) continue; /* found this one */
for(j=0; j<itemList->numitems; j++) {
item = &(itemList->items[j]);
if(strcasecmp(item->name, group->items[i]) == 0) {
/* the number of items matches the number of values exactly */
msGMLWriteItem(stream, item, shape->values[j], namespace, itemtab, outputformat, pszFID);
break;
}
}
}

/* end the group */
if(add_namespace == MS_TRUE)
msIO_fprintf(stream, "%s</%s:%s>\n", tab, namespace, group->name);
else
msIO_fprintf(stream, "%s</%s>\n", tab, group->name);

msFree(itemtab);

return;
}
#endif

gmlGroupListObj *msGMLGetGroups(layerObj *layer, const char *metadata_namespaces)
{
int i;
Expand Down Expand Up @@ -1322,68 +1384,6 @@ void msGMLFreeGroups(gmlGroupListObj *groupList)
free(groupList);
}

static void msGMLWriteGroup(FILE *stream,
gmlGroupObj *group, shapeObj *shape,
gmlItemListObj *itemList,
gmlConstantListObj *constantList,
const char *namespace, const char *tab,
OWSGMLVersion outputformat,
const char *pszFID)
{
int i,j;
int add_namespace = MS_TRUE;
char *itemtab;

gmlItemObj *item=NULL;
gmlConstantObj *constant=NULL;

if(!stream || !group) return;

/* setup the item/constant tab */
itemtab = (char *) msSmallMalloc(sizeof(char)*strlen(tab)+3);

sprintf(itemtab, "%s ", tab);

if(!namespace || strchr(group->name, ':') != NULL) add_namespace = MS_FALSE;

/* start the group */
if(add_namespace == MS_TRUE)
msIO_fprintf(stream, "%s<%s:%s>\n", tab, namespace, group->name);
else
msIO_fprintf(stream, "%s<%s>\n", tab, group->name);

/* now the items/constants in the group */
for(i=0; i<group->numitems; i++) {
for(j=0; j<constantList->numconstants; j++) {
constant = &(constantList->constants[j]);
if(strcasecmp(constant->name, group->items[i]) == 0) {
msGMLWriteConstant(stream, constant, namespace, itemtab);
break;
}
}
if(j != constantList->numconstants) continue; /* found this one */
for(j=0; j<itemList->numitems; j++) {
item = &(itemList->items[j]);
if(strcasecmp(item->name, group->items[i]) == 0) {
/* the number of items matches the number of values exactly */
msGMLWriteItem(stream, item, shape->values[j], namespace, itemtab, outputformat, pszFID);
break;
}
}
}

/* end the group */
if(add_namespace == MS_TRUE)
msIO_fprintf(stream, "%s</%s:%s>\n", tab, namespace, group->name);
else
msIO_fprintf(stream, "%s</%s>\n", tab, group->name);

msFree(itemtab);

return;
}
#endif

/* Dump GML query results for WMS GetFeatureInfo */
int msGMLWriteQuery(mapObj *map, char *filename, const char *namespaces)
{
Expand Down
12 changes: 6 additions & 6 deletions mapogcfilter.cpp
Expand Up @@ -2174,10 +2174,6 @@ const char* FLTGetDuring(FilterEncodingNode *psFilterNode, const char** ppszTime
char *FLTGetSQLExpression(FilterEncodingNode *psFilterNode, layerObj *lp)
{
char *pszExpression = NULL;
const char *pszAttribute = NULL;
char szTmp[256];
char **tokens = NULL;
int nTokens = 0, i=0, bString=0;

if (psFilterNode == NULL || lp == NULL)
return NULL;
Expand Down Expand Up @@ -2215,6 +2211,11 @@ char *FLTGetSQLExpression(FilterEncodingNode *psFilterNode, layerObj *lp)
/* TODO */
} else if (psFilterNode->eType == FILTER_NODE_TYPE_FEATUREID) {
#if defined(USE_WMS_SVR) || defined (USE_WFS_SVR) || defined (USE_WCS_SVR) || defined(USE_SOS_SVR)
const char *pszAttribute = NULL;
char szTmp[256];
char **tokens = NULL;
int nTokens = 0, i=0, bString=0;

if (psFilterNode->pszValue) {
pszAttribute = msOWSLookupMetadata(&(lp->metadata), "OFG", "featureid");
if (pszAttribute) {
Expand Down Expand Up @@ -3126,13 +3127,12 @@ static void FLTRemoveGroupName(FilterEncodingNode *psFilterNode,
void FLTPreParseFilterForAliasAndGroup(FilterEncodingNode *psFilterNode,
mapObj *map, int i, const char *namespaces)
{
#if defined(USE_WMS_SVR) || defined (USE_WFS_SVR) || defined (USE_WCS_SVR) || defined(USE_SOS_SVR)
layerObj *lp=NULL;
char szTmp[256];
const char *pszFullName = NULL;
int layerWasOpened = MS_FALSE;

#if defined(USE_WMS_SVR) || defined (USE_WFS_SVR) || defined (USE_WCS_SVR) || defined(USE_SOS_SVR)

if (psFilterNode && map && i>=0 && i<map->numlayers) {
/*strip name spaces before hand*/
FLTStripNameSpacesFromPropertyName(psFilterNode);
Expand Down
2 changes: 1 addition & 1 deletion mapogcfiltercommon.cpp
Expand Up @@ -516,9 +516,9 @@ std::string FLTGetSpatialComparisonCommonExpression(FilterEncodingNode *psNode,
static std::string FLTGetFeatureIdCommonExpression(FilterEncodingNode *psFilterNode, layerObj *lp)
{
std::string expr;
bool bString= false;

#if defined(USE_WMS_SVR) || defined(USE_WFS_SVR) || defined(USE_WCS_SVR) || defined(USE_SOS_SVR)
bool bString= false;
if (psFilterNode->pszValue) {
const char* pszAttribute = msOWSLookupMetadata(&(lp->metadata), "OFG", "featureid");
if (pszAttribute) {
Expand Down
2 changes: 2 additions & 0 deletions mapogcsld.c
Expand Up @@ -126,6 +126,7 @@ int msSLDApplySLDURL(mapObj *map, const char *szURL, int iLayer,
#endif
}

#if defined(USE_WMS_SVR) || defined (USE_WFS_SVR) || defined (USE_WCS_SVR) || defined(USE_SOS_SVR)
/* -------------------------------------------------------------------- */
/* If the same layer is given more that once, we need to */
/* duplicate it. */
Expand Down Expand Up @@ -165,6 +166,7 @@ static void msSLDApplySLD_DuplicateLayers(mapObj *map, int nSLDLayers, layerObj
}
}
}
#endif

/************************************************************************/
/* msSLDApplySLD */
Expand Down

0 comments on commit b70464e

Please sign in to comment.