James,
we found the problem that caused the bad response of request. The OnlineResource link was wrong due to a ModPython bug. We found a workaround by adding a '/' right before the '?' sign as you can see: 'OurServerUrl:Port/tilecache2/tilecache.py/?'. Without it, the tilecache2/tilecache part was cut.
Our WMS server runs on py and cgi too, so actually, you can use both of them if it helps (we only use the python one and are planning to eliminate the cgi):
- 'OurServerUrl:Port/tilecache2/tilecache.py/?'
- 'OurServerUrl:Port/tilecache/tilecache.cgi?' (no '/' before '?')
We found that there is a function called GetRequestUrl in TiledWmsLayer class. Using this function parameterized with the bounds of the whole world (in EPSG:900913 spherical mercator projection) the return value was a valid url that resulted in the image of the whole world if we typed it into a browser. (The bbox was -20037508.34,-20037508.34,20037508.34,20037508.34 in minx, miny, maxx, maxy order.) The whole request:
OurServerUrl:PORT/tilecache2/tilecache.py/?REQUEST=GetMap&BBOX=-20037508.34,-20037508.34,20037508.34,20037508.34&WIDTH=256&HEIGHT=256&LAYERS=osm&FORMAT=IMAGE/PNG&SRS=EPSG:900913&VERSION=1.1.1&STYLES=&MAPUNIT=DecimalDegree&CLIENTMODE=TiledWmsRasterSource
This way we could ensure that the server responds correctly. Unfortunately the main problem still stand: the map didn't show. The WinformsMap rendered a map filled with images stating 'WMS Client Exception' and 'See Client Trace'. However we could not find the Client Trace. Could you please tell me where can I find this?
I also tried setting TiledWmsLayer.DrawingExceptionMode to DrawingExceptionMode.ThrowException thinking that it would throw an exception rather rendering it on the map, but it did not change anything.
We suspect that our server does not like the request of the WinformsMap in the means of bounding boxes. E.g. your bbox parameters '55.6875,-801.45,1096.3125,-58.95' results in
An error occurred: can't find resolution index for 4.064941. Available resolutions are:
[156543.03390000001, 78271.516950000005, 39135.758475000002, 19567.879237500001, 9783.9396187500006, 4891.9698093750003, 2445.9849046875001, 1222.9924523437501, 611.49622617187504, 305.74811308593752, 152.87405654296876, 76.43702827148438, 38.21851413574219, 19.109257067871095, 9.5546285339355475, 4.7773142669677737, 2.3886571334838869, 1.1943285667419434, 0.59716428337097172, 0.29858214168548586]'
This is tipically the sign of a bad bounding box. I would notice that our server is just capable of returning 256*256px images.
Finally, we are not experienced what bbox values are valid but we noticed that bbox -20037508.34,0,20037508.34,20037508.34 is not good for our WMS server (reply: An error occurred: Current y value 0.000000 is too far from tile corner y 20037508.338400), but 0,0,20037508.34,20037508.34 is.
Thanks
János