MCPcopy Index your code
hub / github.com/MapServer/MapServer / msBuildRequestParams

Function msBuildRequestParams

mapwfslayer.c:64–215  ·  view source on GitHub ↗

/ msBuildRequestParms */ / Build the params object based on the metadata */ information. This object will be used when building the Get */ and Post requsests. */ Note : Verify the connection string to extract some values */ for backward compatiblity. (It is though depricated). */ This will also

Source from the content-addressed store, hash-verified

62/* */
63/************************************************************************/
64static wfsParamsObj *msBuildRequestParams(mapObj *map, layerObj *lp,
65 rectObj *bbox_ret)
66{
67 wfsParamsObj *psParams = NULL;
68 rectObj bbox;
69 const char *pszTmp;
70 int nLength, i = 0;
71 char *pszVersion, *pszTypeName = NULL;
72
73 if (!map || !lp || !bbox_ret)
74 return NULL;
75
76 if (lp->connection == NULL)
77 return NULL;
78
79 psParams = msWFSCreateParamsObj();
80 pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "version");
81 if (pszTmp)
82 psParams->pszVersion = msStrdup(pszTmp);
83 else
84 {
85 pszTmp = strstr(lp->connection, "VERSION=");
86 if (!pszTmp)
87 pszTmp = strstr(lp->connection, "version=");
88 if (pszTmp)
89 {
90 pszVersion = strchr(pszTmp, '=')+1;
91 if (strncmp(pszVersion, "0.0.14", 6) == 0)
92 psParams->pszVersion = msStrdup("0.0.14");
93 else if (strncmp(pszVersion, "1.0.0", 5) == 0)
94 psParams->pszVersion = msStrdup("1.0.0");
95 }
96 }
97
98 /*the service is always set to WFS : see bug 1302 */
99 psParams->pszService = msStrdup("WFS");
100
101 /*
102 pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "service");
103 if (pszTmp)
104 psParams->pszService = msStrdup(pszTmp);
105 else
106 {
107 pszTmp = strstr(lp->connection, "SERVICE=");
108 if (!pszTmp)
109 pszTmp = strstr(lp->connection, "service=");
110 if (pszTmp)
111 {
112 pszService = strchr(pszTmp, '=')+1;
113 if (strncmp(pszService, "WFS", 3) == 0)
114 psParams->pszService = msStrdup("WFS");
115 }
116 }
117 */
118
119 pszTmp = msOWSLookupMetadata(&(lp->metadata), "FO", "typename");
120 if (pszTmp)
121 psParams->pszTypeName = msStrdup(pszTmp);

Callers 1

msPrepareWFSLayerRequestFunction · 0.85

Calls 8

msWFSCreateParamsObjFunction · 0.85
msOWSLookupMetadataFunction · 0.85
msStrdupFunction · 0.85
msStringConcatenateFunction · 0.85
strcasecmpFunction · 0.85
msLoadProjectionStringFunction · 0.85
msProjectionsDifferFunction · 0.85
msProjectRectFunction · 0.85

Tested by

no test coverage detected