Skip to content

Commit

Permalink
setup correct map scale and units for WFS queries if using vector til…
Browse files Browse the repository at this point in the history
…e driver
  • Loading branch information
tbonfort committed Sep 14, 2015
1 parent e837275 commit 50c3a44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mapserver.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ extern "C" {
#define MS_DRIVER_GDAL(format) (strncasecmp((format)->driver,"gdal/",5)==0) #define MS_DRIVER_GDAL(format) (strncasecmp((format)->driver,"gdal/",5)==0)
#define MS_DRIVER_IMAGEMAP(format) (strncasecmp((format)->driver,"imagemap",8)==0) #define MS_DRIVER_IMAGEMAP(format) (strncasecmp((format)->driver,"imagemap",8)==0)
#define MS_DRIVER_AGG(format) (strncasecmp((format)->driver,"agg/",4)==0) #define MS_DRIVER_AGG(format) (strncasecmp((format)->driver,"agg/",4)==0)
#define MS_DRIVER_MVT(format) (strncasecmp((format)->driver,"mvt/",4)==0) #define MS_DRIVER_MVT(format) (strncasecmp((format)->driver,"mvt",3)==0)
#define MS_DRIVER_CAIRO(format) (strncasecmp((format)->driver,"cairo/",6)==0) #define MS_DRIVER_CAIRO(format) (strncasecmp((format)->driver,"cairo/",6)==0)
#define MS_DRIVER_OGL(format) (strncasecmp((format)->driver,"ogl/",4)==0) #define MS_DRIVER_OGL(format) (strncasecmp((format)->driver,"ogl/",4)==0)
#define MS_DRIVER_TEMPLATE(format) (strncasecmp((format)->driver,"template",8)==0) #define MS_DRIVER_TEMPLATE(format) (strncasecmp((format)->driver,"template",8)==0)
Expand Down
9 changes: 9 additions & 0 deletions mapwfs.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ static int msWFSGetFeatureApplySRS(mapObj *map, const char *srs, int nWFSVersion
} else { } else {
msLoadProjectionString(&(map->projection), pszOutputSRS); msLoadProjectionString(&(map->projection), pszOutputSRS);
} }

nTmp = GetMapserverUnitUsingProj(&(map->projection));
if( nTmp != -1 ) {
map->units = nTmp;
}
} }


if (pszOutputSRS) if (pszOutputSRS)
Expand Down Expand Up @@ -2610,6 +2615,10 @@ this request. Check wfs/ows_enable_request settings.", "msWFSGetFeature()",
map->query.mode = MS_QUERY_MULTIPLE; map->query.mode = MS_QUERY_MULTIPLE;
map->query.rect = bbox; map->query.rect = bbox;


if(map->outputformat && MS_DRIVER_MVT(map->outputformat)) {
msCalculateScale(bbox,map->units,map->width,map->height, map->resolution, &map->scaledenom);
}

if(msQueryByRect(map) != MS_SUCCESS) { if(msQueryByRect(map) != MS_SUCCESS) {
errorObj *ms_error; errorObj *ms_error;
ms_error = msGetErrorObj(); ms_error = msGetErrorObj();
Expand Down

0 comments on commit 50c3a44

Please sign in to comment.