Changeset 421

Show
Ignore:
Timestamp:
11/12/08 17:41:59 (8 weeks ago)
Author:
arneke
Message:

Cleaning up old sins that should no longer be required.

Location:
trunk/geowebcache/src/main/java/org/geowebcache
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/geowebcache/src/main/java/org/geowebcache/layer/MetaTile.java

    r318 r421  
    104104    private int[] calculateMetaTileGridBounds(int[] gridBounds, 
    105105            int[] tileGridPosition) { 
    106         // Sanity checks that are hopefully redundant 
    107         // if( tileGridPosition[0] < gridBounds[0] || tileGridPosition[0] > 
    108         // gridBounds[2] 
    109         // || tileGridPosition[1] < gridBounds[1] || tileGridPosition[1] > 
    110         // gridBounds[3]) { 
    111         // log.error("calculateMetaTileGridBounds(): " + 
    112         // Arrays.toString(gridBounds) +" does not contain "+ 
    113         // Arrays.toString(tileGridPosition) ); 
    114         // return null; 
    115         // } 
    116106 
    117107        int[] metaTileGridBounds = new int[5]; 
  • trunk/geowebcache/src/main/java/org/geowebcache/layer/wms/WMSMetaTile.java

    r338 r421  
    7878        GridCalculator gridCalc = wmsLayer.getGrid(srs).getGridCalculator(); 
    7979        BBOX metaBbox = gridCalc.bboxFromGridBounds(metaTileGridBounds); 
    80         metaBbox.adjustForGeoServer(srs); 
    8180        wmsparams.setBBOX(metaBbox); 
    8281 
  • trunk/geowebcache/src/main/java/org/geowebcache/util/wms/BBOX.java

    r337 r421  
    225225       coords[3] = coords[3] + ydiff; 
    226226    } 
    227      
    228      
    229     /** 
    230      * GeoServer fails the entire tile if it crosses the max extents, dateline boundary. 
    231      *  
    232      * This reduces the bounding box slightly, to accomodate for this. 
    233      *  
    234      * This is a bad hack, but a necessary one. 
    235      *  
    236      * @param srs 
    237      * @throws BBOXException  
    238      */ 
    239     public void adjustForGeoServer(SRS srs) throws BBOXException { 
    240         double minX = 0; 
    241         double minY = 0; 
    242         double maxX = 0; 
    243         double maxY = 0; 
    244          
    245         if(srs.getNumber() == 900913) { 
    246             minX = -20037508.34 * 0.995; 
    247             minY = -20037508.34 * 0.995; 
    248             maxX = 20037508.34 * 0.995; 
    249             maxY = 20037508.34 * 0.995; 
    250                          
    251         } else if(srs.getNumber() == 4326) { 
    252             minX = -180.0 * 0.995; 
    253             minY = -90.0 * 0.995; 
    254             maxX = 180.0 * 0.995; 
    255             maxY =  90.0 * 0.995; 
    256         } else { 
    257             return; 
    258         } 
    259          
    260         if(this.coords[0] < minX) { 
    261             this.coords[0] = minX; 
    262             log.trace("Limited minX bounds "+Double.toString(minX)+" to avoid GeoServer problems"); 
    263         } 
    264         if(this.coords[1] < minY) { 
    265             this.coords[1] = minY; 
    266             log.trace("Limited minY bounds "+Double.toString(minY)+" to avoid GeoServer problems"); 
    267         } 
    268         if(this.coords[2] > maxX) { 
    269             this.coords[2] = maxX; 
    270             log.trace("Limited maxX bounds "+Double.toString(maxX)+" to avoid GeoServer problems"); 
    271         } 
    272         if(this.coords[3] > maxY) { 
    273             this.coords[3] = maxY; 
    274             log.trace("Limited maxY bounds "+Double.toString(maxY)+" to avoid GeoServer problems"); 
    275         } 
    276          
    277         // Need to do another sanity check at this point 
    278         if(! this.isSane()) { 
    279                 throw new BBOXException("Adjusted BBOX " + this.toString() + " is no longer sane."); 
    280         } 
    281     } 
    282227}