Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] GeoServer SLD style filter problem with latest GeoMesa

Thanks Emilio!  It’s not the first time I’ve reported a problem within days of you fixing it.

 

Beau

 

From: geomesa-users-bounces@xxxxxxxxxxxxxxxx [mailto:geomesa-users-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Emilio Lahr-Vivaz
Sent: Thursday, July 31, 2014 2:52 PM
To: geomesa-users@xxxxxxxxxxxxxxxx
Subject: Re: [geomesa-users] GeoServer SLD style filter problem with latest GeoMesa

 

Hi Beau,

I believe that this issue has recently been fixed. The commit in question is 1e916f71dd5d834b7cda59a4ad52159b4007b69e, which was just pushed yesterday. In versions older than that, 'equals' queries are very broken.

I verified that the following filter works for me in geoserver 2.5.1, using the latest geomesa and the geomesa-tutorial twitter data with extended attributes (http://geomesa.github.io/2014/05/16/geomesa-tubeselect/):

<?xml version="1.0" encoding="ISO-8859-1"?>
<
StyledLayerDescriptor version="1.0.0"
  
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
  
xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
  
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <
NamedLayer>
    <
Name>nullfilter</Name>
    <
UserStyle>
      <
Title>nullfilter</Title>
      <
Abstract>Checks for null attributes</Abstract>
      <
FeatureTypeStyle>
        <
Rule>
          <
Name>attequals</Name>
          <
ogc:Filter>
            <
ogc:PropertyIsEqualTo>
              <
ogc:Function name="isNull">
                <
ogc:Function name="property">
                  <
ogc:Function name="env">
                    <
ogc:Literal>attribute</ogc:Literal>
                    <
ogc:Literal>in_reply_to_user_id</ogc:Literal>
                  </
ogc:Function>
                </
ogc:Function>
              </
ogc:Function>
              <
ogc:Literal>false</ogc:Literal>
            </
ogc:PropertyIsEqualTo>
          </
ogc:Filter>
          <
PointSymbolizer>
            <
Graphic>
              <
Mark>
                <
WellKnownName>circle</WellKnownName>
                <
Fill>
                  <
CssParameter name="fill">#7853DE</CssParameter>                                        
                  <
CssParameter name="fill-opacity">0.1</CssParameter>
                </
Fill>
              </
Mark>
              <
Size>6</Size>
            </
Graphic>
          </
PointSymbolizer>
        </
Rule>
      </
FeatureTypeStyle>
    </
UserStyle>
  </
NamedLayer>
</
StyledLayerDescriptor>

Turning on the geomesa trace logging, the requests translated to the following queries (without the style and then with it):

FastBBOX [property=geom, envelope=ReferencedEnvelope[-80.671875 : -78.328125, 39.9140625 : 41.0859375]]

[FastBBOX [property=geom, envelope=ReferencedEnvelope[-80.671875 : -78.328125, 39.9140625 : 41.0859375]] AND [ isNull([property([in_reply_to_user_id])]) = false ]]

Let me know if I can be any more help,

Thanks,

Emilio

On 07/31/2014 12:26 PM, Beau Lalonde wrote:

Hi,

 

We just installed the latest GeoMesa earlier this week and we have noticed a new GeoServer/WMS related problem that did not exist in either the mid-June version of GeoMesa or the January version of GeoMesa.  We are using GeoServer 2.5 and GeoTools 11.0.

 

I am using an SLD style for generating choropleth images (similar to a heat map) based upon GeoMesa-indexed data.  I want all null data to be ignored when I create my choropleth images, and prior to the most recent GeoMesa, I could successfully ignore null data if I did something analogous to the following in my SLD file:

 

<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">

  <sld:NamedLayer>

    <sld:Name>Default Styler</sld:Name>

    <sld:UserStyle>

      <sld:Name>Default Styler</sld:Name>

      <sld:Title>Example Title</sld:Title>

      <sld:FeatureTypeStyle>

        <sld:Name>name</sld:Name>

        <sld:Rule>

          <sld:Name>ExampleName</sld:Name>

          <ogc:Filter>

            <ogc:PropertyIsEqualTo>

              <ogc:Function name="isNull">

                <ogc:Function name="property">

                  <ogc:Function name="env">

                    <ogc:Literal>attribute</ogc:Literal>

                    <ogc:Literal>SpecificAttribute</ogc:Literal>

                  </ogc:Function>

                </ogc:Function>

              </ogc:Function>

              <ogc:Literal>false</ogc:Literal>

            </ogc:PropertyIsEqualTo>

          </ogc:Filter>

          <sld:MaxScaleDenominator>1000000.0</sld:MaxScaleDenominator>

          <sld:PolygonSymbolizer>

          …

 

I should note that I am using SLD variable substitution for the “attribute” so that I can use the same SLD style for generating choropleth images based on different attributes (using separate WMS calls). 

 

When I use the above style, GeoServer does not produce an image.  It seems to have a problem with the <ogc:Filter> portion of the style.  If I remove the <ogc:Filter> portion of the SLD style, the style works on attributes that do not have null data.  Is this problem a GeoMesa-related bug?  Or have we integrated the latest GeoMesa incorrectly with GeoServer?  What changes have been made since mid-June that could cause this problem?

 

 

In case it helps, the following SLD filter worked in the January version of GeoMesa, but did not work in the mid-June version.  I assumed that it was due to the GeoServer version changing, but now I am not so sure it wasn’t GeoMesa-related.  When I noticed that this did not work in the mid-June version, I removed the “equalTo” portion of the filter and instead created two SLD styles (my preference was to have one style, which is what I had when I used the January version).

 

          <ogc:Filter>

            <ogc:And>

              <ogc:PropertyIsEqualTo>

                <ogc:Function name="equalTo">

                  <ogc:Function name="env">

                    <ogc:Literal>attribute</ogc:Literal>

                    <ogc:Literal>SpecificAttribute</ogc:Literal>

                  </ogc:Function>

                  <ogc:Literal>SpecificAttribute</ogc:Literal>

                </ogc:Function>

                <ogc:Literal>false</ogc:Literal>

              </ogc:PropertyIsEqualTo>

              <ogc:PropertyIsEqualTo>

                <ogc:Function name="isNull">

                  <ogc:Function name="property">

                    <ogc:Function name="env">

                      <ogc:Literal>attribute</ogc:Literal>

                      <ogc:Literal>SpecificAttribute</ogc:Literal>

                    </ogc:Function>

                  </ogc:Function>

                </ogc:Function>

                <ogc:Literal>false</ogc:Literal>

              </ogc:PropertyIsEqualTo>

            </ogc:And>

          </ogc:Filter>

 

 

Any ideas?

 

Thanks,

 

Beau




_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
http://www.locationtech.org/mailman/listinfo/geomesa-users

 


Back to the top