//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)
String layerName = this.currentLayer.getLayerNameNS();
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 workSpace = layerInfo.getWorkspaceName();
Map<String, String> describeLayerInfo = getWfsDescribeLayerInfo();
int epsgCode = 4326;//we are filtering the bounds based on WGS84
String geometryColumn = describeLayerInfo.get("geometryColumn");
String nameSpace = describeLayerInfo.get("nameSpace");
String bboxFilter = "";
if (!nativeBounds.isEquivalent(bounds)){
bboxFilter += "<ogc:Filter>"
+ "<ogc:BBOX>"
+ "<ogc:PropertyName>" + geometryColumn + "</ogc:PropertyName>"
+ bounds.generateGMLEnvelope(epsgCode)
+ "</ogc:BBOX>"
+ "</ogc:Filter>";
}
// TODO should be xml
String getFeatureRequest = "<wfs:GetFeature service=\"WFS\" version=\"1.1.0\""