Skip to content

Commit cf065f3

Browse files
msmitherdcdmorissette
authored andcommitted
When WFS changes the map->projection, also project the default map->extent (#5065)
1 parent 1fdcb04 commit cf065f3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

mapwfs.c

+13-1
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,21 @@ static int msWFSGetFeatureApplySRS(mapObj *map, const char *srs, int nWFSVersion
368368
same srs. For wfs 1.1.0 an srsName can be passed, we should validate that It is valid for all
369369
queries layers
370370
*/
371+
372+
/* Start by applying the default service SRS to the mapObj,
373+
* make sure we reproject the map extent if a projection was
374+
* already set
375+
*/
371376
pszMapSRS = msOWSGetEPSGProj(&(map->projection), &(map->web.metadata), "FO", MS_TRUE);
372-
if(pszMapSRS && nWFSVersion > OWS_1_0_0)
377+
if(pszMapSRS && nWFSVersion > OWS_1_0_0){
378+
projectionObj proj;
379+
msInitProjection(&proj);
380+
if (map->projection.numargs > 0 && msLoadProjectionStringEPSG(&proj, pszMapSRS) == 0) {
381+
msProjectRect(&(map->projection), &proj, &map->extent);
382+
}
373383
msLoadProjectionStringEPSG(&(map->projection), pszMapSRS);
384+
msFreeProjection(&proj);
385+
}
374386

375387
if (srs == NULL || nWFSVersion == OWS_1_0_0) {
376388
for (i=0; i<map->numlayers; i++) {

0 commit comments

Comments
 (0)