tile.setHint(req.toLowerCase());
tile.setRequestHandler(ConveyorTile.RequestHandler.SERVICE);
return tile;
}
if (layers == null) {
throw new ServiceException("Unable to parse layers parameter from request.");
}
// Check whether this request is missing tiled=true
final boolean tiled = Boolean.valueOf(values.get("tiled"));
if (proxyNonTiledRequests && tiled) {
ConveyorTile tile = new ConveyorTile(sb, layers, request, response);
tile.setHint(req);
tile.setRequestHandler(Conveyor.RequestHandler.SERVICE);
return tile;
}
TileLayer tileLayer = tld.getTileLayer(layers);
String[] paramKeys = { "format", "srs", "bbox" };
final Map<String, String> paramValues = ServletUtils.selectedStringsFromMap(
requestParameterMap, encoding, paramKeys);
final Map<String, String> fullParameters = tileLayer.getModifiableParameters(
requestParameterMap, encoding);
final MimeType mimeType;
String format = paramValues.get("format");
try {
mimeType = MimeType.createFromFormat(format);
} catch (MimeException me) {
throw new ServiceException("Unable to determine requested format, " + format);
}
final SRS srs;
{
String requestSrs = paramValues.get("srs");
if (requestSrs == null) {
throw new ServiceException("No SRS specified");
}
srs = SRS.getSRS(requestSrs);
}
GridSubset gridSubset = tileLayer.getGridSubsetForSRS(srs);
if (gridSubset == null) {
throw new ServiceException("Unable to match requested SRS " + srs
+ " to those supported by layer");
}
final BoundingBox bbox;
{
String requestBbox = paramValues.get("bbox");
try {
bbox = new BoundingBox(requestBbox);
if (bbox == null || !bbox.isSane()) {
throw new ServiceException("The bounding box parameter (" + requestBbox
+ ") is missing or not sane");
}
} catch (NumberFormatException nfe) {
throw new ServiceException("The bounding box parameter (" + requestBbox
+ ") is invalid");
}
}
final int tileWidth = Integer.parseInt(values.get("width"));