[Geoserver-users] Dynamic filter in SLD?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Geoserver-users] Dynamic filter in SLD?

Gavin Fleming-2
I'm using geoserver to serve up live fire detections from a PostGIS data store. I have a WMS layer defined on a PostGIS view that shows all fires in the past 24h. I'd like to symbolise fires of different ages differently, but obviously can't use the normal static literals to do this in SLD.
 
Here is an attempt to do this by encoding a PostGIS function as a literal. It doesn't work, but it doesn't exclude records either, so my guess it's just doing a string comparison. It's difficult not knowing where the filter parameters are actually handled - in GeoServer, in PostGIS or where?
 
('storetick' is a timestamp field)
 
          <ogc:Filter>
            <ogc:And>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>origin</ogc:PropertyName>
                <ogc:Literal>M</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsLessThan>
                <ogc:PropertyName>storetick</ogc:PropertyName>
                <ogc:Literal>(CURRENT_TIMESTAMP - interval '1 hour')</ogc:Literal>
              </ogc:PropertyIsLessThan>
            </ogc:And>
          </ogc:Filter>
 
Can you suggest how to make this work?
 
I'm using MapBuilder as a client - what about using a variable in SLD in the web context doc that gets generated by some javascript on each request, using surrent system time?
 
Or any other approach?
 
hope that's clear.
 
thanks
 
Gavin

--
This message is subject to the CSIR's copyright, terms and conditions and e-mail legal notice.
Views expressed herein do not necessarily represent the views of the CSIR.

CSIR E-mail Legal Notice

CSIR Copyright, Terms and Conditions

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR Legal Notice
send a blank message with "REQUEST LEGAL" in the subject line to [hidden email]


This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.

Reply | Threaded
Open this post in threaded view
|

[Geoserver-users] Re: [Mapbuilder-devel] Dynamic filter in SLD?

Radim Blazek-2
Do you have MB > Tue Nov 15 09:56:58 2005?

Radim

On 11/24/05, Gavin Fleming <[hidden email]> wrote:

>
> I'm using geoserver to serve up live fire detections from a PostGIS data
> store. I have a WMS layer defined on a PostGIS view that shows all fires in
> the past 24h. I'd like to symbolise fires of different ages differently, but
> obviously can't use the normal static literals to do this in SLD.
>
> Here is an attempt to do this by encoding a PostGIS function as a literal.
> It doesn't work, but it doesn't exclude records either, so my guess it's
> just doing a string comparison. It's difficult not knowing where the filter
> parameters are actually handled - in GeoServer, in PostGIS or where?
>
> ('storetick' is a timestamp field)
>
>           <ogc:Filter>
>             <ogc:And>
>               <ogc:PropertyIsEqualTo>
>                 <ogc:PropertyName>origin</ogc:PropertyName>
>                 <ogc:Literal>M</ogc:Literal>
>               </ogc:PropertyIsEqualTo>
>               <ogc:PropertyIsLessThan>
>
> <ogc:PropertyName>storetick</ogc:PropertyName>
>                 <ogc:Literal>(CURRENT_TIMESTAMP - interval '1
> hour')</ogc:Literal>
>               </ogc:PropertyIsLessThan>
>             </ogc:And>
>           </ogc:Filter>
>
> Can you suggest how to make this work?
>
> I'm using MapBuilder as a client - what about using a variable in SLD in the
> web context doc that gets generated by some javascript on each request,
> using surrent system time?
>
> Or any other approach?
>
> hope that's clear.
>
> thanks
>
> Gavin
> --
> This message is subject to the CSIR's copyright, terms and conditions and
> e-mail legal notice.
> Views expressed herein do not necessarily represent the views of the CSIR.
>
> CSIR E-mail Legal Notice
>
> CSIR Copyright, Terms and Conditions
>
> For electronic copies of the CSIR Copyright, Terms and Conditions and the
> CSIR Legal Notice
> send a blank message with "REQUEST LEGAL" in the subject line to CSIR
> HelpDesk
>
>
> This message has been scanned for viruses and dangerous content by
> MailScanner,
> and is believed to be clean. MailScanner thanks Transtec Computers for their
> support.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users