OgpHttpClient ogpHttpClient;
@Override
public File downloadZipFile(String layerId, BoundingBox bounds) throws Exception{
SolrRecord layerInfo = layerInfoRetriever.getAllLayerInfo(layerId);
//requests too near the poles are problematic
BoundingBox requestBounds = null;
Double requestMinY = bounds.getMinY();
if (requestMinY < -85.0){
requestMinY = -85.0;
}
Double requestMaxY = bounds.getMaxY();
if (requestMaxY > 85.0){
requestMaxY = 85.0;
}
requestBounds = new BoundingBox(bounds.getMinX(), requestMinY, bounds.getMaxX(), requestMaxY);
String workspace = layerInfo.getWorkspaceName();
String layerName = layerInfo.getName();
String requestString = "request=GetFeature&version=1.1.0&outputFormat=shape-zip";
requestString += "&typeName=" + workspace + ":" + layerName;
requestString += "&srsName=EPSG:4326";
requestString += "&BBOX=" + requestBounds.toString() + ",EPSG:4326";
HttpClient httpclient = ogpHttpClient.getHttpClient();
File outputFile = null;
String wfsLocation = ParseJSONSolrLocationField.getWfsUrl(layerInfo.getLocation());
HttpGet httpget = new HttpGet(wfsLocation + "?" + requestString);
logger.info("executing request " + httpget.getURI());
try {