[Tilecache] Tilecache/Geoserver UTM bbox reprojection problem

David E. Reksten der at dod.no
Mon Nov 12 10:31:50 EST 2007


Hi, I have set up a Geoserver (1.6.0b4) WMS service with Tilecache
(1.9). However, it seems that Openlayers reprojects the bbox
coordinates when composing the url to Tilecache.

In Tilecache.cfg:
[my_layer]
type=WMSLayer
srs=EPSG:32632
url=http://srv-sql-test:8080/geoserver/wms?transparent=yes
extension=png
layers=my_wms_layer_group
bbox=234794.87858842534,6402796.894299105,1339110.328571976,8020412.976632362
size=425,550
debug=yes
extent_type=loose
maxResolution=6318.812821614287


In Openlayers (based on Geoserver preview html):
      var bounds = new
OpenLayers.Bounds(234794.87858842534,6402796.894299105,1339110.328571976,8020412.976632362);
      untiled = new OpenLayers.Layer.WMS.Untiled(
        "Geoserver layers", "http://localhost:8080/",
        {
          height: '550',
          width: '425',
          layers: 'my_layer',
          styles: '',
          srs: 'EPSG:32632',
          format: 'image/png'
        },
        {maxExtent: bounds, maxResolution: 6318.812821614287,
projection: "EPSG:32632",  reproject: false}
      );
      untiled.ratio=1;
      map.addLayer(untiled);

Sample URL generated by Openlayer:
http://localhost:8080/?HEIGHT=550&WIDTH=425&LAYERS=my_layer&STYLES=&SRS=EPSG%3A32632&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=115578.74128368264,6342768.172493769,1458326.4658767185,8080441.698437698

This returns the following error:
"An error occurred: Current x value 115578.741284 is too far from tile
corner x 234794.878588"

If I replace the faulty bbox in the above url with the "proper" bbox,
everything works perfectly.

After spending many hours on this, I can't understand why the bbox in
the URL doesn't match tileconfig.cfg or the Openlayer definition. Is
there any reprojection involved here, that I'm not aware of? Is there
a setting that I have missed?

And what is this ratio property? I have tried to play around with it,
and found that it indeed does influence the bbox values, but I have
not been able to determine precisely how and why.

Any ideas?

David



More information about the Tilecache mailing list