if (layerInfo == null) {
throw new ServiceException("Could not find layer " + layerName, "LayerNotDefined");
}
if (layerInfo instanceof SecuredLayerInfo && boundingBox != null) {
//test layer bbox limits
SecuredLayerInfo securedLayerInfo = (SecuredLayerInfo) layerInfo;
WrapperPolicy policy = securedLayerInfo.getWrapperPolicy();
AccessLimits limits = policy.getLimits();
if (limits instanceof DataAccessLimits) {
//ensure we are all using the same CRS
CoordinateReferenceSystem dataCrs = layerInfo.getResource().getCRS();