Permalink
Browse files

When WFS changes the map->projection, also project the default map->e…

…xtent (#5065)
  • Loading branch information...
msmitherdc authored and dmorissette committed Feb 10, 2015
1 parent 1fdcb04 commit cf065f3e71fb23ab1cd6e8a65d50e530bbf33e15
Showing with 13 additions and 1 deletion.
  1. +13 −1 mapwfs.c
View
@@ -368,9 +368,21 @@ static int msWFSGetFeatureApplySRS(mapObj *map, const char *srs, int nWFSVersion
same srs. For wfs 1.1.0 an srsName can be passed, we should validate that It is valid for all
queries layers
*/
+
+ /* Start by applying the default service SRS to the mapObj,
+ * make sure we reproject the map extent if a projection was
+ * already set
+ */
pszMapSRS = msOWSGetEPSGProj(&(map->projection), &(map->web.metadata), "FO", MS_TRUE);
- if(pszMapSRS && nWFSVersion > OWS_1_0_0)
+ if(pszMapSRS && nWFSVersion > OWS_1_0_0){
+ projectionObj proj;
+ msInitProjection(&proj);
+ if (map->projection.numargs > 0 && msLoadProjectionStringEPSG(&proj, pszMapSRS) == 0) {
+ msProjectRect(&(map->projection), &proj, &map->extent);
+ }
msLoadProjectionStringEPSG(&(map->projection), pszMapSRS);
+ msFreeProjection(&proj);
+ }
if (srs == NULL || nWFSVersion == OWS_1_0_0) {
for (i=0; i<map->numlayers; i++) {

0 comments on commit cf065f3

Please sign in to comment.