Fix for Spatial Filtering Profile envelope query and not support extent function

Fix problem with query for Spatial Filtering Profile envelope for database that do not support the spatial extent function.