//--generate POST message
//info needed: geometry column, bbox coords, epsg code, workspace & layername
//all client bboxes should be passed as lat-lon coords. we will need to get the appropriate epsg code for the layer
//in order to return the file in original projection to the user (will also need to transform the bbox)
SolrRecord layerInfo = this.currentLayer.getLayerInfo();
BoundingBox nativeBounds = new BoundingBox(layerInfo.getMinX(), layerInfo.getMinY(), layerInfo.getMaxX(), layerInfo.getMaxY());
BoundingBox bounds = nativeBounds.getIntersection(this.currentLayer.getRequestedBounds());
String layerName = this.currentLayer.getLayerNameNS();
//for now we'll force wgs84. we'll revisit if we need something different
int epsgCode = 4326;
/*
geoserver/wms?VERSION=1.3.0&REQUEST=GetMap&CRS=epsg:4326&BBOX=-90,-180,90,180&...
The format_options is a container for parameters that are format specific. The options in it are expressed as:
param1:value1;param2:value2;...
The currently recognized format options are:
antialiasing (on, off, text): allows to control the use of antialiased rendering in raster outputs.
dpi: sets the rendering dpi in raster outputs. The OGC standard dpi is 90, but if you need to perform
high resolution printouts it is advised to grab a larger image and set a higher dpi. For example, to
print at 300dpi a 100x100 image it is advised to ask for a 333x333 image setting the dpi value at 300.
In general the image size should be increased by a factor equal to targetDpi/90 and the target dpi set
in the format options.
*/
//height and width should be calculated based on the bounds
Map<String,String> requestDimensions = this.calculateDimensions(bounds.getAspectRatio());
String format = this.currentLayer.getRequestedFormat();
if (format.toLowerCase().equals("geotiff")){
format = "image/geotiff";
}
String getFeatureRequest = "SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=epsg:" +
epsgCode + "&BBOX=" + bounds.toString() + "&LAYERS=" + layerName +
"&HEIGHT=" + requestDimensions.get("height") + "&WIDTH=" + requestDimensions.get("width") +
"&FORMAT=" + format;
if (!format.equals("kmz")){
getFeatureRequest += "&TILED=no";
} else {