@@ -729,6 +729,31 @@ static FilterEncodingNode* FLTGetTopBBOX(FilterEncodingNode *psNode)
729
729
return psTopBBOX ;
730
730
}
731
731
732
+ /************************************************************************/
733
+ /* FLTLayerSetInvalidRectIfSupported */
734
+ /* */
735
+ /* This function will set in *rect a very huge extent if the layer */
736
+ /* wfs_use_default_extent_for_getfeature metadata item is set to false */
737
+ /* and the layer supports such degenerate rectangle, as a hint that */
738
+ /* they should not issue a spatial filter. */
739
+ /************************************************************************/
740
+
741
+ int FLTLayerSetInvalidRectIfSupported (layerObj * lp ,
742
+ rectObj * rect )
743
+ {
744
+ const char * pszUseDefaultExtent = msOWSLookupMetadata (& (lp -> metadata ), "F" ,
745
+ "use_default_extent_for_getfeature" );
746
+ if ( pszUseDefaultExtent && !CSLTestBoolean (pszUseDefaultExtent ) &&
747
+ (lp -> connectiontype == MS_OGR ||
748
+ ((lp -> connectiontype == MS_PLUGIN ) && (strstr (lp -> plugin_library ,"msplugin_mssql2008" ) != NULL ))) )
749
+ {
750
+ const rectObj rectInvalid = MS_INIT_INVALID_RECT ;
751
+ * rect = rectInvalid ;
752
+ return MS_TRUE ;
753
+ }
754
+ return MS_FALSE ;
755
+ }
756
+
732
757
/************************************************************************/
733
758
/* FLTLayerApplyPlainFilterToLayer */
734
759
/* */
@@ -743,19 +768,10 @@ int FLTLayerApplyPlainFilterToLayer(FilterEncodingNode *psNode, mapObj *map,
743
768
744
769
pszExpression = FLTGetCommonExpression (psNode , lp );
745
770
if (pszExpression ) {
746
- const char * pszUseDefaultExtent ;
747
771
FilterEncodingNode * psTopBBOX ;
748
772
rectObj rect = map -> extent ;
749
773
750
- pszUseDefaultExtent = msOWSLookupMetadata (& (lp -> metadata ), "F" ,
751
- "use_default_extent_for_getfeature" );
752
- if ( pszUseDefaultExtent && !CSLTestBoolean (pszUseDefaultExtent ) &&
753
- (lp -> connectiontype == MS_OGR ||
754
- ((lp -> connectiontype == MS_PLUGIN ) && (strstr (lp -> plugin_library ,"msplugin_mssql2008" ) != NULL ))) )
755
- {
756
- const rectObj rectInvalid = MS_INIT_INVALID_RECT ;
757
- rect = rectInvalid ;
758
- }
774
+ FLTLayerSetInvalidRectIfSupported (lp , & rect );
759
775
760
776
psTopBBOX = FLTGetTopBBOX (psNode );
761
777
if ( psTopBBOX )
0 commit comments