Tim,
Not sure if you've hit on this suggestion already, but a much much *much* lower tech way of doing this (no need to write any interceptors, datastores or anything!) would be to just define two SLDs, each relevant to the right featuretype.
I.e:
1) low-res-polys = one feature type (connected to your generalized data) with its own SLD. Put a MinScaleDenominator in this SLD, so that it turns 'off' when you zoom in past its useful level.
2) high-res-points = one feature type (connected to your actual 100,000,000 records) with its own SLD. Put a MaxScaleDenominator in this SLD, so that it doesn't render at higher scales.
The last step is to set up a map viewer with BOTH layers ALWAYS turned on. As long as the minscaledenominator of the one lines up with the maxscaledenominator of the other, users will have a 'seamless' transition between the two...and you don't have to write any code! You just have to make a map view that occludes what's actually going on in the back-ground (two layers in geoserver -> one layer in the viewer)
The down-side of this approach is that geoserver will still willingly attempt to render 100,000,000 points with a custom SLD, if a user were to craft his/her own SLD and send it along. A more interesting question is whether you could code support for "disabling" custom SLDs on a layer-by-layer basis. That way you could disable any custom SLDs for your really big layer.
Am I repeating something that someone else already said? Is this too low-tech of a way to solve this problem?
--saul
-----Original Message-----
From: geoserver-users-bounces@lists.sourceforge.net on behalf of trobertson@anonymised.com
Sent: Fri 4/6/2007 4:41 PM
To: geoserver users
Subject: [Geoserver-users] AOP to modify the WMS request?
Hi,
I am still finding my feet with Geoserver and PostGIS, but have both built
and running from source now. My motivation for doing this is to find a
fairly simply / standards comliant way of serving WMS for 100,000,000
specimen/observation records within the Biodiversity field (www.gbif.org).
I have tested postgis and mysql behind geoserver each serving 1 million
records on the same schema and both perform pretty similarly (although
mysql was over 10x quicker to populate with records).
However, at a global view, obviously this is a daft approach as individual
points at this scale is meaningles - I already have the data in collated
counts at 1x1 degree cells, so anything with a bounding box search greater
than say 20x20 degrees, I wish to return from the counts table (e.g. 1x1
degree cells with varying colours based on the count within the cell -
using rules in the SLD), otherwise I would return the individual records
as points when zoomed in enough.
So - is a suitable approach for me to set up 2 datastores against the 2
tables, and then intercept the request using an AOP interceptor and modify
it based on the bounding box?
What is my alternative? - implement my own datastore?
Or how else can you swap layers based on zoom level?
Alternatively, how do people generally hook in an existing DAO / Service
layer - implement the data store?
Thanks all - I'd appreciate any thoughts / suggestions / pointing out the
obvious - I am new to this!
Tim
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users