Skip to content

Commit

Permalink
finalize adding new GeometryName parameter to choose the Geometry col…
Browse files Browse the repository at this point in the history
…umn ot he remote WFS
  • Loading branch information
yjacolin authored and tbonfort committed Sep 24, 2012
1 parent 99e5ab5 commit 8931146
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions mapows.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ typedef struct {
char *pszService;
char *pszTypeName;
char *pszFilter;
char *pszGeometryName;
int nMaxFeatures;
char *pszBbox; /* only used with a Get Request */
char *pszOutputFormat; /* only used with DescibeFeatureType */
Expand Down
13 changes: 9 additions & 4 deletions mapwfslayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static wfsParamsObj *msBuildRequestParams(mapObj *map, layerObj *lp,
rectObj bbox;
const char *pszTmp;
int nLength, i = 0;
char *pszVersion, *pszTypeName = NULL;
char *pszVersion, *pszTypeName, *pszGeometryName = NULL;

if (!map || !lp || !bbox_ret)
return NULL;
Expand Down Expand Up @@ -114,6 +114,10 @@ static wfsParamsObj *msBuildRequestParams(mapObj *map, layerObj *lp,
}
*/

pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "geometryname");
if (pszTmp)
psParams->pszGeometryName = msStrdup(pszTmp);

pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "typename");
if (pszTmp)
psParams->pszTypeName = msStrdup(pszTmp);
Expand Down Expand Up @@ -232,8 +236,9 @@ static char *msBuildWFSLayerPostRequest(mapObj *map, layerObj *lp,
}


if (psParams->pszGeometryName)
nGeometryName = psParams->pszGeometryName);
if (psParams->pszGeometryName) {
nGeometryName = psParams->pszGeometryName;
}

if (psParams->pszFilter)
pszFilter = psParams->pszFilter;
Expand All @@ -242,7 +247,7 @@ static char *msBuildWFSLayerPostRequest(mapObj *map, layerObj *lp,
pszFilter = (char *)msSmallMalloc(bufferSize);
snprintf(pszFilter, bufferSize, "<ogc:Filter>\n"
"<ogc:BBOX>\n"
"<ogc:PropertyName>%f</ogc:PropertyName>\n"
"<ogc:PropertyName>%s</ogc:PropertyName>\n"
"<gml:Box>\n"
"<gml:coordinates>%f,%f %f,%f</gml:coordinates>\n"
"</gml:Box>\n"
Expand Down

0 comments on commit 8931146

Please sign in to comment.