Index: /trunk/include/mapnik/feature_style_processor.hpp
===================================================================
--- /trunk/include/mapnik/feature_style_processor.hpp (revision 770)
+++ /trunk/include/mapnik/feature_style_processor.hpp (revision 789)
@@ -126,4 +126,11 @@
                   prj_trans.backward(lx0,ly0,lz0);
                   prj_trans.backward(lx1,ly1,lz1);
+
+                  // if no intersection then nothing to do for layer
+                  if ( lx0 > ext.maxx() || lx1 < ext.minx() || ly0 > ext.maxy() || ly1 < ext.miny() )
+                  {
+                     return;
+                  }
+                  
                   // clip query bbox
                   lx0 = std::max(ext.minx(),lx0);
Index: /trunk/src/envelope.cpp
===================================================================
--- /trunk/src/envelope.cpp (revision 603)
+++ /trunk/src/envelope.cpp (revision 789)
@@ -240,12 +240,15 @@
     Envelope<T> Envelope<T>::intersect(const EnvelopeType& other) const
     {
-
-        T x0=std::max(minx_,other.minx_);
-        T y0=std::max(miny_,other.miny_);
-
-        T x1=std::min(maxx_,other.maxx_);
-        T y1=std::min(maxy_,other.maxy_);
-
-        return Envelope<T>(x0,y0,x1,y1);
+        if (intersects(other)) {
+            T x0=std::max(minx_,other.minx_);
+            T y0=std::max(miny_,other.miny_);
+
+            T x1=std::min(maxx_,other.maxx_);
+            T y1=std::min(maxy_,other.maxy_);
+
+            return Envelope<T>(x0,y0,x1,y1);
+        } else {
+            return Envelope<T>();
+        }
     }
 
