1

So basically, I have a map at day D. On this day X objects are represented with a color and full opacity.

What I'd like to do is to be able to represent on this map the Y objects present on the map at D-1, D-2, ..., D-25, on which I ll apply a gradually decreasing opacity.

Currently, I bound an SLD file to my layer with 25 rules. A rule define the opacity and the color of the object (1 rule for 1 day, so a rule for D-1, a rule for D-2 etc).

But this is not working, as geoserver is giving me back a GC overhead limit exceeded error.

Is there any other way to do it ? I may be unclear, so feel free to ask for more details, I ll edit my post.

EDIT : heres a peek at my SLD.

This is the rule I repeat 25 times in my SLD file. What change between each rule are the variables dateXmin and dateXmax who become dateXminJ1 and dateXmaxJ1 and so on 'till dateXminJ25 and dateXmaxJ25.

For the record I have a SLD file that repeat this rule 3 times, and Geoserver is giving me back an image almost instantly.

<FeatureTypeStyle>
                <Rule>
                    <Name>style_update_img</Name>
                    <ogc:Filter>
                        <ogc:And>
                            <ogc:Or>
                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name1</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name2</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name3</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name4</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name5</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name6</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name7</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name8</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name9</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>

                                <ogc:PropertyIsEqualTo>
                                    <ogc:PropertyName>table_name</ogc:PropertyName>
                                    <ogc:Function name="env"><ogc:Literal>name10</ogc:Literal><ogc:Literal>default</ogc:Literal></ogc:Function>
                                </ogc:PropertyIsEqualTo>
                            </ogc:Or>

                            <ogc:And>
                                <ogc:PropertyIsGreaterThanOrEqualTo>
                                    <ogc:PropertyName>daterec</ogc:PropertyName>
                                    <ogc:Function name="strConcat">
                                        <ogc:Function name="env"><ogc:Literal>dateXmin</ogc:Literal><ogc:Literal>2017-01-01</ogc:Literal></ogc:Function><ogc:Literal>T00:00:00.0Z</ogc:Literal>
                                    </ogc:Function>
                                </ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyIsLessThan>
                                    <ogc:PropertyName>daterec</ogc:PropertyName>
                                    <ogc:Function name="strConcat">
                                        <ogc:Function name="env"><ogc:Literal>dateXmax</ogc:Literal><ogc:Literal>2017-01-01</ogc:Literal></ogc:Function><ogc:Literal>T00:00:00.0Z</ogc:Literal>
                                    </ogc:Function>
                                </ogc:PropertyIsLessThan>
                            </ogc:And>
                        </ogc:And>
                    </ogc:Filter>

                    <PolygonSymbolizer>
                        <Geometry>
                            <ogc:Function name="buffer">
                                <ogc:PropertyName>geom</ogc:PropertyName>
                                <ogc:Function name="env"><ogc:Literal>buffer</ogc:Literal><ogc:Literal>200</ogc:Literal></ogc:Function>
                            </ogc:Function>
                        </Geometry>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Function name="strConcat">
                                    <ogc:Literal>#</ogc:Literal><ogc:Function name="env"><ogc:Literal>color</ogc:Literal><ogc:Literal>B9121B</ogc:Literal></ogc:Function>                                     
                                </ogc:Function>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>0.92</ogc:Literal>
                            </CssParameter>
                        </Fill>            
                    </PolygonSymbolizer>

                    <LineSymbolizer>
                        <Stroke>
                            <CssParameter name="stroke">
                                <ogc:Literal>#</ogc:Literal><ogc:Function name="env"><ogc:Literal>color</ogc:Literal><ogc:Literal>B9121B</ogc:Literal></ogc:Function>
                            </CssParameter>
                            <CssParameter name="stroke-opacity">
                                <ogc:Literal>0.87</ogc:Literal>
                            </CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
            </FeatureTypeStyle>
7
  • just increase the memory available - stackoverflow.com/questions/41742058/…
    – Ian Turton
    Commented Jun 21, 2017 at 13:26
  • @iant The error is not raise, but I don't even reach the end of the map loading..
    – Asew
    Commented Jun 21, 2017 at 14:28
  • did you increase the amount of memory?
    – Ian Turton
    Commented Jun 21, 2017 at 14:30
  • Yes, from 1024 to 2048. But geoserver is taking way to long to generate my image.
    – Asew
    Commented Jun 21, 2017 at 14:32
  • then you can turn up the time out, or speed up the map draw with an index or fix the sld but then we'd need to see some of it
    – Ian Turton
    Commented Jun 21, 2017 at 14:33

1 Answer 1

0

You can handle time natively in GeoServer.

Read this article in the manual about doing it.

I haven't got a vector layer immediately available to demonstrate it, but you can set it up on the 'Dimensions' tab for a layer.

Once set, it's simply another parameter in your WMS request. You may have luck using one of the Leaflet plugins that handles time.

2
  • that won't show them dimming over time though (with out the SLD file)
    – Ian Turton
    Commented Jun 21, 2017 at 13:48
  • I've looked into it, and I don't see how it could help me with my problem.
    – Asew
    Commented Jun 21, 2017 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.