[OpenLayers-Users] SQL in an SLD - possible?

Eoin Mac Aoidh eoinyp at yahoo.com
Tue Mar 9 11:42:41 EST 2010


Hi all,
I have just got to grips with basic SLD templates. Now I would like to apply an SLD template and include an SQL condition in it. Im not sure exactly how, or if its possible.
I would like to follow a simple Attribute-based point example where point size is set on a less than or equal basis. e.g.
 <Rule>
       ....
       <ogc:Filter>
         <ogc:PropertyIsLessThan>
           <ogc:PropertyName>pop</ogc:PropertyName>
           <ogc:Literal>50000</ogc:Literal>
         </ogc:PropertyIsLessThan>
       </ogc:Filter>
      .....
     </Rule>
 
In my case, I do not have a property such as population, rather I would like to have the point size set depending on the count of attributes with a specific value (the value is actually location, so the more points with the same (lat,lon) the bigger I would like to have the symbol at that point drawn)

In other words, I am trying to do something like this:
 <Rule>
       ....
       <ogc:Filter>

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

           if count result = 3, then use a point of diameter 3
           if count result = 4, then use a point of diameter 4

       </ogc:Filter>
      .....
     </Rule>

Does anyone have any hints on how to go about this?
Many thanks,

Eoin.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100309/4819022a/attachment.html


More information about the Users mailing list