[Geoserver-devel] Filters within SLD

Hi,
I just try to get around myself, but I am really stuck. I would like to
have query, which actually is based on a defined SLD. The Filter I added
in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this:
new NumericAttributeType("TOLERANCE", Double.class, false,new Double(0),
org.geotools.filter.FilterFactory.createFilterFactory().createCompareFil
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I only
can access the BoundingBox of the query. The actual Filter for the
property is not included. So what do I do wrong here? Is the type of
filter wrong?

The Style is created correctly and also passed to the Layer in
GetMapResponse:142. I checked that.

Cheers

  Theodor

ITC, Enschede
Department of Geo Information Processing PO. Box 6 7500 AA Enschede the
Netherlands

Theodor Foerster wrote:

Hi,
I just try to get around myself, but I am really stuck. I would like to
have query, which actually is based on a defined SLD. The Filter I added
in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this: new NumericAttributeType("TOLERANCE", Double.class, false,new Double(0),
org.geotools.filter.FilterFactory.createFilterFactory().createCompareFil
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I only
can access the BoundingBox of the query. The actual Filter for the
property is not included. So what do I do wrong here? Is the type of
filter wrong?
  

No I do not think so, for a JDBCDataStore you get a chance to process the filter and say what parts you support (sounds like bounding box), and the
"leftovers" are handled by GeoTools as a "post process" (aka after you have returned all the ones that match the bounding box).

Depending on the renderer used they may just ask for *all* the features in the bounding box, and then throw each feature past the different Rules.

At least one of the Renderers has been "optimized" to make each Rule a seperate datastore request. I know they did this on the complex feature store branch - you may need to check what your version of geoserver is doing.

Cheers,
Jody

Ok. But how is it the WFS extension doing? It should be able to include
the Filter in the request, but not filtering the Features out, after
receiving the complete Collection of the FeatureType.

Best regards

  Theodor

-----Original Message-----
From: Jody Garnett [mailto:jgarnett@anonymised.com]
Sent: Wednesday, September 06, 2006 3:23 PM
To: Theodor Foerster
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Filters within SLD

Theodor Foerster wrote:

Hi,
I just try to get around myself, but I am really stuck. I would like
to have query, which actually is based on a defined SLD. The Filter I
added in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this:
new NumericAttributeType("TOLERANCE", Double.class, false,new
Double(0),
org.geotools.filter.FilterFactory.createFilterFactory().createCompareF
il
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I only

can access the BoundingBox of the query. The actual Filter for the
property is not included. So what do I do wrong here? Is the type of
filter wrong?
  

No I do not think so, for a JDBCDataStore you get a chance to process
the filter and say what parts you support (sounds like bounding box),
and the "leftovers" are handled by GeoTools as a "post process" (aka
after you have returned all the ones that match the bounding box).

Depending on the renderer used they may just ask for *all* the features
in the bounding box, and then throw each feature past the different
Rules.

At least one of the Renderers has been "optimized" to make each Rule a
seperate datastore request. I know they did this on the complex feature
store branch - you may need to check what your version of geoserver is
doing.

Cheers,
Jody

Good question, what do you mean by the WFS extention (do you mean WFS Model for geoserver offering WFS service, or do you mean the WFSDataStore used to chain GeoServer to a different WFS?).

The WFS Capabilities document does document how much of the filter spec is supported, and your query is well within the limits. I really think this is up to the renderer used, it will see WFS as a simple DataStore and make the query as it sees fit.

Each renderer can make use of the SLD Filter information as it sees fit, constructing many or one WFS request. There may be a hint for the renderers that tell it to make many small queries ... lets ask GeoTools devel.

Jody

Ok. But how is it the WFS extension doing? It should be able to include
the Filter in the request, but not filtering the Features out, after
receiving the complete Collection of the FeatureType.

Best regards

  Theodor

-----Original Message-----
From: Jody Garnett [mailto:jgarnett@anonymised.com] Sent: Wednesday, September 06, 2006 3:23 PM
To: Theodor Foerster
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Filters within SLD

Theodor Foerster wrote:
  

Hi,
I just try to get around myself, but I am really stuck. I would like to have query, which actually is based on a defined SLD. The Filter I added in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this: new NumericAttributeType("TOLERANCE", Double.class, false,new Double(0), org.geotools.filter.FilterFactory.createFilterFactory().createCompareF
il
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I only
    
can access the BoundingBox of the query. The actual Filter for the property is not included. So what do I do wrong here? Is the type of filter wrong?
  

No I do not think so, for a JDBCDataStore you get a chance to process
the filter and say what parts you support (sounds like bounding box),
and the "leftovers" are handled by GeoTools as a "post process" (aka
after you have returned all the ones that match the bounding box).

Depending on the renderer used they may just ask for *all* the features
in the bounding box, and then throw each feature past the different
Rules.

At least one of the Renderers has been "optimized" to make each Rule a
seperate datastore request. I know they did this on the complex feature
store branch - you may need to check what your version of geoserver is
doing.

Cheers,
Jody

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
  

I do mean the WFSDataStore. But if the SLD includes a filter, it should
provide this information also to the underlying dataStore, just for
optimization purposes...

Looking forward for further suggestions.

Theodor

-----Original Message-----
From: Jody Garnett [mailto:jgarnett@anonymised.com]
Sent: Wednesday, September 06, 2006 6:09 PM
To: Theodor Foerster
Cc: geoserver-devel@lists.sourceforge.net; GeoTools Devel List
Subject: Re: [Geoserver-devel] Filters within SLD

Good question, what do you mean by the WFS extention (do you mean WFS
Model for geoserver offering WFS service, or do you mean the
WFSDataStore used to chain GeoServer to a different WFS?).

The WFS Capabilities document does document how much of the filter spec
is supported, and your query is well within the limits. I really think
this is up to the renderer used, it will see WFS as a simple DataStore
and make the query as it sees fit.

Each renderer can make use of the SLD Filter information as it sees fit,
constructing many or one WFS request. There may be a hint for the
renderers that tell it to make many small queries ... lets ask GeoTools
devel.

Jody

Ok. But how is it the WFS extension doing? It should be able to
include the Filter in the request, but not filtering the Features out,

after receiving the complete Collection of the FeatureType.

Best regards

  Theodor

-----Original Message-----
From: Jody Garnett [mailto:jgarnett@anonymised.com]
Sent: Wednesday, September 06, 2006 3:23 PM
To: Theodor Foerster
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Filters within SLD

Theodor Foerster wrote:
  

Hi,
I just try to get around myself, but I am really stuck. I would like
to have query, which actually is based on a defined SLD. The Filter I

added in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this:

new NumericAttributeType("TOLERANCE", Double.class, false,new
Double(0),
org.geotools.filter.FilterFactory.createFilterFactory().createCompare
F
il
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I
only
    
can access the BoundingBox of the query. The actual Filter for the
property is not included. So what do I do wrong here? Is the type of
filter wrong?
  

No I do not think so, for a JDBCDataStore you get a chance to process
the filter and say what parts you support (sounds like bounding box),
and the "leftovers" are handled by GeoTools as a "post process" (aka
after you have returned all the ones that match the bounding box).

Depending on the renderer used they may just ask for *all* the
features in the bounding box, and then throw each feature past the
different Rules.

At least one of the Renderers has been "optimized" to make each Rule a

seperate datastore request. I know they did this on the complex
feature store branch - you may need to check what your version of
geoserver is doing.

Cheers,
Jody

----------------------------------------------------------------------
--- Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job

easier Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=1216
42 _______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
  

Does your datastore make a FilterCapabilities? This is necessary to advertise to the other classes that your datastore can handle it. If the filtercapabilities aren't present for the filters then they won't make it to the datastore.

I just dug in to the code, and the default is to try to pass filters back to the datastore, at least if you're using png, jpeg or gif output. Others may not properly get all the filters back.

Chris

Theodor Foerster wrote:

Hi,
I just try to get around myself, but I am really stuck. I would like to
have query, which actually is based on a defined SLD. The Filter I added
in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this: new NumericAttributeType("TOLERANCE", Double.class, false,new Double(0),
org.geotools.filter.FilterFactory.createFilterFactory().createCompareFil
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I only
can access the BoundingBox of the query. The actual Filter for the
property is not included. So what do I do wrong here? Is the type of
filter wrong?

The Style is created correctly and also passed to the Layer in
GetMapResponse:142. I checked that.

Cheers

  Theodor

ITC, Enschede
Department of Geo Information Processing PO. Box 6 7500 AA Enschede the
Netherlands

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:1003,44febb6e12821510810322!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Oh, that s cool. Where and how can I indicate such FilterCapabilities?
Because in practice it would be possible, just to translate the
parameters of a process to a filters.

Theodor

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: Wednesday, September 06, 2006 6:39 PM
To: Theodor Foerster
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Filters within SLD

Does your datastore make a FilterCapabilities? This is necessary to
advertise to the other classes that your datastore can handle it. If
the filtercapabilities aren't present for the filters then they won't
make it to the datastore.

I just dug in to the code, and the default is to try to pass filters
back to the datastore, at least if you're using png, jpeg or gif output.

  Others may not properly get all the filters back.

Chris

Theodor Foerster wrote:

Hi,
I just try to get around myself, but I am really stuck. I would like
to have query, which actually is based on a defined SLD. The Filter I
added in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this:
new NumericAttributeType("TOLERANCE", Double.class, false,new
Double(0),
org.geotools.filter.FilterFactory.createFilterFactory().createCompareF
il
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I only

can access the BoundingBox of the query. The actual Filter for the
property is not included. So what do I do wrong here? Is the type of
filter wrong?

The Style is created correctly and also passed to the Layer in
GetMapResponse:142. I checked that.

Cheers

  Theodor

ITC, Enschede
Department of Geo Information Processing PO. Box 6 7500 AA Enschede
the Netherlands

----------------------------------------------------------------------
--- Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job

easier Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=1216
42 _______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:1003,44febb6e12821510810322!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Postgis does it in the filter encoder: http://svn.geotools.org/geotools/branches/2.2.x/plugin/postgis/src/org/geotools/filter/SQLEncoderPostgis.java

I believe it's called in the sqlbuilder:
http://svn.geotools.org/geotools/branches/2.2.x/module/main/src/org/geotools/data/jdbc/DefaultSQLBuilder.java

I think that this is one level removed from you want though, this is how the sql encoder thing splits things up.

You're extending abstractdatastore, yeah?

http://svn.geotools.org/geotools/branches/2.2.x/module/main/src/org/geotools/data/AbstractDataStore.java

You just want to add the logic to process your filters in to there.

WFSDatastore does some fancy stuff of checking out the supported filters from the capabilities document and then just using those. I imagine you could just hardcode in passing back certain filters to your datastore.

If you jump on irc - irc://irc.freenode.net#geoserver I can try to help you directly.

(though I'm going to lunch very soon, so may not catch you for another hour or two).

Chris

Theodor Foerster wrote:

Oh, that s cool. Where and how can I indicate such FilterCapabilities?
Because in practice it would be possible, just to translate the
parameters of a process to a filters.

Theodor

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com] Sent: Wednesday, September 06, 2006 6:39 PM
To: Theodor Foerster
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Filters within SLD

Does your datastore make a FilterCapabilities? This is necessary to
advertise to the other classes that your datastore can handle it. If
the filtercapabilities aren't present for the filters then they won't
make it to the datastore.

I just dug in to the code, and the default is to try to pass filters
back to the datastore, at least if you're using png, jpeg or gif output.

  Others may not properly get all the filters back.

Chris

Theodor Foerster wrote:

Hi,
I just try to get around myself, but I am really stuck. I would like to have query, which actually is based on a defined SLD. The Filter I added in the SLD looks like this:
              <ogc:Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
                <ogc:PropertyIsEqualTo>
                  <ogc:PropertyName>TOLERANCE</ogc:PropertyName>
                  <ogc:Literal>17.5005</ogc:Literal>
                </ogc:PropertyIsEqualTo>
              </ogc:Filter>

So now I have an attribute in the FeatureType, which looks like this: new NumericAttributeType("TOLERANCE", Double.class, false,new Double(0), org.geotools.filter.FilterFactory.createFilterFactory().createCompareF
il
ter(CompareFilter.COMPARE_EQUALS))

When the Query is passed to my DataStore at getFeatureReader(), I only

can access the BoundingBox of the query. The actual Filter for the property is not included. So what do I do wrong here? Is the type of filter wrong?

The Style is created correctly and also passed to the Layer in GetMapResponse:142. I checked that.

Cheers

  Theodor

ITC, Enschede
Department of Geo Information Processing PO. Box 6 7500 AA Enschede the Netherlands

----------------------------------------------------------------------
--- Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job

easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=1216
42 _______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

!DSPAM:1003,44fefa7c50151665516417!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org