[OpenLayers-Users] SQL in an SLD

Rick Wayne fewayne at wisc.edu
Tue Mar 9 12:10:35 EST 2010


Hullo Eoin,

> SELECT DISTINCT ( COUNT( point_geom))
>  FROM (SELECT point_geom? FROM locations where point_type = 3) AS foo
> GROUP BY point_geom;

We get around this kind of thing by creating views in the database,  
which synthesize the values we want to depict via SLD. Something like

CREATE VIEW TYPE_3_COUNT AS
	SELECT DISTINCT ( COUNT( point_geom)) AS count_thingy
	 FROM (SELECT point_geom? FROM locations where point_type = 3) AS foo
	 GROUP BY point_geom;

Then you use TYPE_3_COUNT as a datasource, and put the count_thingy  
"column" in the OGC filter.

HTH,

rw



More information about the Users mailing list