I have a set of layers, each covering one country. In my OpenLayers client, I enable users to randomly draw a polygon. A user is then able to perform analysis based on the drawn polygon. Analysis include getting the population covered by the polygon, population density of the area covered by the polygon, etc.
This separation of data into separate layers is for performance reasons, as there are millions of grid record data. Putting all this data in one layer is likely to degrade performance considerably.
This works perfectly within a single country, which is represented by a single layer in GeoServer. However, I want to enable users to draw a polygon that covers sections in more than one country. This means that to perform the analysis, data must be extracted from all the affected layers. I'm looking for a pure OpenLayers+GeoServer approach of achieving this. The features extracted are then passed to a GeoServer WPS process.
My attempt so far:
I've created one layer group that includes all the layers for all the countries. I wish to load as minimal data as possible to the client. Which means I can't use WMSGetFeatureInfo, or the WFS version that retrieves information based on a WMS layer. Which means that the layer group approach may not be the appropriate one.
All my processing is done in WPS processes. It's only the result that is sent to the OpenLayers client.
Any suggestions will be appreciated very much.
My environment: GeoServer 2.1.3, PostGIS 1.5, OpenLayers 2.11.