Changeset 770

Show
Ignore:
Timestamp:
11/19/08 16:50:12 (21 months ago)
Author:
artem
Message:

+ applied patch avoid_extent from rcoup

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/include/mapnik/feature_style_processor.hpp

    r768 r770  
    111111            { 
    112112               Envelope<double> const& ext=m_.getCurrentExtent(); 
     113               Envelope<double> bbox(ext); 
    113114               projection proj1(lay.srs()); 
    114115               proj_transform prj_trans(proj0,proj1); 
    115  
    116                Envelope<double> layer_ext = lay.envelope(); 
    117                double lx0 = layer_ext.minx(); 
    118                double ly0 = layer_ext.miny(); 
    119                double lz0 = 0.0; 
    120                double lx1 = layer_ext.maxx(); 
    121                double ly1 = layer_ext.maxy(); 
    122                double lz1 = 0.0; 
    123                // back project layers extent into main map projection 
    124                prj_trans.backward(lx0,ly0,lz0); 
    125                prj_trans.backward(lx1,ly1,lz1); 
    126                // clip query bbox 
    127                lx0 = std::max(ext.minx(),lx0); 
    128                ly0 = std::max(ext.miny(),ly0); 
    129                lx1 = std::min(ext.maxx(),lx1); 
    130                ly1 = std::min(ext.maxy(),ly1); 
    131116                
    132                prj_trans.forward(lx0,ly0,lz0); 
    133                prj_trans.forward(lx1,ly1,lz1); 
    134                Envelope<double> bbox(lx0,ly0,lx1,ly1); 
     117               if (proj0 != proj1) { 
     118                  Envelope<double> layer_ext = lay.envelope(); 
     119                  double lx0 = layer_ext.minx(); 
     120                  double ly0 = layer_ext.miny(); 
     121                  double lz0 = 0.0; 
     122                  double lx1 = layer_ext.maxx(); 
     123                  double ly1 = layer_ext.maxy(); 
     124                  double lz1 = 0.0; 
     125                  // back project layers extent into main map projection 
     126                  prj_trans.backward(lx0,ly0,lz0); 
     127                  prj_trans.backward(lx1,ly1,lz1); 
     128                  // clip query bbox 
     129                  lx0 = std::max(ext.minx(),lx0); 
     130                  ly0 = std::max(ext.miny(),ly0); 
     131                  lx1 = std::min(ext.maxx(),lx1); 
     132                  ly1 = std::min(ext.maxy(),ly1); 
     133 
     134                  prj_trans.forward(lx0,ly0,lz0); 
     135                  prj_trans.forward(lx1,ly1,lz1); 
     136                  bbox = Envelope<double>(lx0,ly0,lx1,ly1); 
     137               } 
    135138               double resolution = m_.getWidth()/bbox.width(); 
    136139               query q(bbox,resolution); //BBOX query 
  • trunk/include/mapnik/projection.hpp

    r632 r770  
    5858         
    5959        projection& operator=(projection const& rhs); 
     60        bool operator==(const projection& other) const; 
     61        bool operator!=(const projection& other) const; 
    6062        bool is_initialized() const; 
    6163        bool is_geographic() const; 
  • trunk/src/projection.cpp

    r655 r770  
    5353        return *this; 
    5454    } 
    55          
     55     
     56    bool projection::operator==(const projection& other) const  
     57    { 
     58        return (params_ == other.params_); 
     59    } 
     60     
     61    bool projection::operator!=(const projection& other) const  
     62    { 
     63        return !(*this == other); 
     64    } 
     65     
    5666    bool projection::is_initialized() const 
    5767    {