How do I propagate failures from upstream wms-servers?

Trond Michelsen trondmm-mapserver at CRUSADERS.NO
Tue Nov 13 16:53:32 EST 2007


On Tue, Nov 13, 2007 at 10:16:38AM -0700, Ben Tuttle wrote:
>> I think the silence is an indication that there is no way to ask
>> MapServer to produce an exception in this case at the moment.
>> I'd suggest you file a ticket proposing that as an enhancement.
> Given that mapserver can't do this at the moment have you considered
> other options?

Yes, I have, and I do have options. One of the things I've noticed is
that I can actually get mapserver to generate an error. I just have to
get the remote WMS server to generate a broken reply. If the remote
WMS returns anything other than application/vnd.ogc.se_xml, mapserver
will try to load it as an image. If it isn't an image, mapserver will
fail, and return a proper exception. This will actually take care of
most of the situations. But mapserver will still generate blank images
if it's unable to contact the remote WMS or if it returns any other
HTTP status than 200.

> While it probably not as efficient you might be able to set up a
> cron to watch your cache for new images and do a "gdalinfo -mm" on
> each new tile in the cache and delete tiles with only one value (ie
> blank tiles).

As Daniel said, this won't work, since blank images can be valid as
well. In this particular case, the remote WMS-server serves weather
data. Precipitation, to be exact. So, if there's no rain or snow in an
area, the response will be a blank image.

Right now, the simplest solution seems to be to not fetch the weather
data through mapserver. Just get the client to fetch the data directly
from the other WMS-server. The only problem is that this server
doesn't generate transparent images, so I'll need to hack on it a bit
to add this functionality.

-- 
Trond Michelsen



More information about the mapserver-users mailing list