I have to develop a webapp that will have to display a large number of polygons on a webpage, with complex filtering options. The source data never changes (I will simply reload a new version of the DB every few months).
From the developer point of view, a more confortable/flexible approach seems to use GeoDjango and its spatially-enabled data models to generate a dynamic (content and styling) KML file of my data. A (probably naive) elegant solution would be to integrate WMS rendering (and possibly caching) layer between the OpenLayers client and the GeoDjango app that generates KML output.
The workflow would be:
Openlayers sends user query to "intermediate layer"
This layers forward query to the GeoDjango app, get a KML file and render it as WMS and return it to OpenLayers.
(alternatively, OL could also talk directly to GeoDjango it sould use a middleware to postprocess its KML result before returning it).
As my data almost never changes, I could then benefit from a caching tool such as GeoWebCache between OL and the "rendering layer".
I know Google Maps API do server-side rendering of KML files when they are large, but it's a black box tied to their JS library, and I'd really like to do something similar with OL.
I've done a few searches, but was not able to find any tool for the "intermediate layer". WMS servers such as GeoServer/Mapserver can use a KML data source, but it seems limited to a static file somewhere in the filesystem, and not from a dynamic URL.
Does a tool like this exists ? Or is my approach simply wrong ?