[mapserver-users] How to handle unavailable data source in mapObj layer?

Paolo Corti pcorti at gmail.com
Tue Jul 31 10:14:39 PDT 2012


Hi

> Our layers largely draw from database tables, lately we've started consuming
> remote WMS services and have found that these services are occassionally
> unavailable (such as reporting a "404" HTTP status). The "draw()" method
> throws an exception in such a case, reporting within the exception message
> the failing layer and the status.
>
>
>
> Is there a way to change this behavior? We'd like a softer landing: could we
> define the "must have" layers and allow others to be drawn or skipped based
> upon data availability. We'd also want to be able to query the mapObj
> regarding each layer's success or failure.
>

I maybe wrong, but I do not think there is a way to manage this from MapServer.
As you are using mapscript to compose the map, you could check it out
by code the correct response, and only in that case add the layer to
the map.
Another possible approach, if applicable (the data are not changing
too often) could be to cache the WMS with a tile server, and use the
tiles instead than WMS, with the big plus of having better performance
as well.

best regards
p

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti



More information about the MapServer-users mailing list