[Geoserver-users] WMS GetFeatureInfo requests that require post filtering do not work well with maxFeatures

Hi,

I have encountered a problem that may or may not be a duplicate of the issue GEOS-5377 (http://jira.codehaus.org/browse/GEOS-5377).

I have a WMS layer with a very complex SLD. Well, maybe not so complex, but very, very long with many, many rules. If I do a GetFeatureInfo request for that layer and I have the maxFeatures parameter set, GeoServer sometimes gives me a result that seems to be missing features.

It appears that the maxFeatures limit is applied to the feature result set before the rules of the SLD are applied and this leads to a result set with fewer features than maxFeatures although there may be more than maxFeatures features that do satisfy all conditions (SLD rules, filters, etc.) of the GetFeatureInfo request.

Also, the problem only seem to present itself when the SLD contains many rules. The GEOS-5377 issue suggests more than 20 and so does the code (GetFeatureInfo.java, the identifyVectorLayer method).

I hope anyone can help me with this and if it turns out to be a bug, creates an issue for it or helps me in doing so.

/ Johan

Hi Johan,
If you’ve not heard anything off-list, I’d suggest re-opening that ticket with your findings in it, or creating a new one
Regards,
Jonathan.

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

On 22 November 2013 13:59, Johan Behrenfeldt <johan.behrenfeldt@anonymised.com> wrote:

Hi,

I have encountered a problem that may or may not be a duplicate of the issue GEOS-5377 (http://jira.codehaus.org/browse/GEOS-5377).

I have a WMS layer with a very complex SLD. Well, maybe not so complex, but very, very long with many, many rules. If I do a GetFeatureInfo request for that layer and I have the maxFeatures parameter set, GeoServer sometimes gives me a result that seems to be missing features.

It appears that the maxFeatures limit is applied to the feature result set before the rules of the SLD are applied and this leads to a result set with fewer features than maxFeatures although there may be more than maxFeatures features that do satisfy all conditions (SLD rules, filters, etc.) of the GetFeatureInfo request.

Also, the problem only seem to present itself when the SLD contains many rules. The GEOS-5377 issue suggests more than 20 and so does the code (GetFeatureInfo.java, the identifyVectorLayer method).

I hope anyone can help me with this and if it turns out to be a bug, creates an issue for it or helps me in doing so.

/ Johan


Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi,
personally I did not answer because the question lacks a fundamental information: the geoserver version number.
Without it, we may as well think the version being used was on originally affected by the bug :-p

Cheers
Andrea

···

On Tue, Nov 26, 2013 at 12:00 PM, Jonathan Moules <jonathanmoules@anonymised.com> wrote:

Hi Johan,
If you’ve not heard anything off-list, I’d suggest re-opening that ticket with your findings in it, or creating a new one
Regards,
Jonathan.

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On 22 November 2013 13:59, Johan Behrenfeldt <johan.behrenfeldt@anonymised.com> wrote:

Hi,

I have encountered a problem that may or may not be a duplicate of the issue GEOS-5377 (http://jira.codehaus.org/browse/GEOS-5377).

I have a WMS layer with a very complex SLD. Well, maybe not so complex, but very, very long with many, many rules. If I do a GetFeatureInfo request for that layer and I have the maxFeatures parameter set, GeoServer sometimes gives me a result that seems to be missing features.

It appears that the maxFeatures limit is applied to the feature result set before the rules of the SLD are applied and this leads to a result set with fewer features than maxFeatures although there may be more than maxFeatures features that do satisfy all conditions (SLD rules, filters, etc.) of the GetFeatureInfo request.

Also, the problem only seem to present itself when the SLD contains many rules. The GEOS-5377 issue suggests more than 20 and so does the code (GetFeatureInfo.java, the identifyVectorLayer method).

I hope anyone can help me with this and if it turns out to be a bug, creates an issue for it or helps me in doing so.

/ Johan


Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi,

My mistake! Of course, I should’ve included that piece of information.

The version in which I encountered my problem is 2.1.3 (subversion: revision 16668).

If I look at the GEOS-5377 ticket, I can see that was fixed in version 2.2.2 and upgrading to version 2.2.2 or later may solve my problem. However, this is an issue that I’ve encountered in a production environment where I cannot upgrade GeoServer without going through a long process and I would want to be rather certain that the upgrade will fix my problem before going through that process.

Is there any way I can see what code changes were made to resolve the ticket? Seeing what code was changed to fix the ticket would give me a chance to make a qualified guess whether my problem has been solved or not.

Regards,

Johan

···

Hi,

personally I did not answer because the question lacks a fundamental information: the geoserver version number.

Without it, we may as well think the version being used was on originally affected by the bug :-p

Cheers

Andrea

On Tue, Nov 26, 2013 at 12:00 PM, Jonathan Moules <jonathanmoules@anonymised.com> wrote:

Hi Johan,

If you’ve not heard anything off-list, I’d suggest re-opening that ticket with your findings in it, or creating a new one

Regards,

Jonathan.

On 22 November 2013 13:59, Johan Behrenfeldt <johan.behrenfeldt@anonymised.com> wrote:

Hi,

I have encountered a problem that may or may not be a duplicate of the issue GEOS-5377 (http://jira.codehaus.org/browse/GEOS-5377).

I have a WMS layer with a very complex SLD. Well, maybe not so complex, but very, very long with many, many rules. If I do a GetFeatureInfo request for that layer and I have the maxFeatures parameter set, GeoServer sometimes gives me a result that seems to be missing features.

It appears that the maxFeatures limit is applied to the feature result set before the rules of the SLD are applied and this leads to a result set with fewer features than maxFeatures although there may be more than maxFeatures features that do satisfy all conditions (SLD rules, filters, etc.) of the GetFeatureInfo request.

Also, the problem only seem to present itself when the SLD contains many rules. The GEOS-5377 issue suggests more than 20 and so does the code (GetFeatureInfo.java, the identifyVectorLayer method).

I hope anyone can help me with this and if it turns out to be a bug, creates an issue for it or helps me in doing so.

/ Johan


Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it


On Tue, Nov 26, 2013 at 2:48 PM, Johan Behrenfeldt <
johan.behrenfeldt@anonymised.com> wrote:

Hi,

My mistake! Of course, I should’ve included that piece of information.

The version in which I encountered my problem is 2.1.3 (subversion:
revision 16668).

If I look at the GEOS-5377 ticket, I can see that was fixed in version
2.2.2 and upgrading to version 2.2.2 or later may solve my problem.
However, this is an issue that I’ve encountered in a production environment
where I cannot upgrade GeoServer without going through a long process and I
would want to be rather certain that the upgrade will fix my problem before
going through that process.

Is there any way I can see what code changes were made to resolve the
ticket? Seeing what code was changed to fix the ticket would give me a
chance to make a qualified guess whether my problem has been solved or not.

Aaah... See, that makes it very easy to answer:
https://github.com/geoserver/geoserver/commit/9f159ded4f0c8da8c3742bdbdbb2463b9cf42a10

and as a patch:
https://github.com/geoserver/geoserver/commit/9f159ded4f0c8da8c3742bdbdbb2463b9cf42a10.patch

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hi,

Thank you for your quick response!

I get the feeling that the ticket GEOS-5377 is not the same problem as I’m having. I believe that my problem arises from these lines of code in GetFeatureInfo.identifyVectorLayer:

FeatureCollection<? extends FeatureType, ? extends Feature> match;

match = featureSource.getFeatures(q);

// if we could not include the rules filter into the query, post process in

// memory

if (!Filter.INCLUDE.equals(postFilter)) {

match = new FilteringFeatureCollection(match, postFilter);

}

The query, q, in the call to the getFeatures method is defined as:

Query q = new Query(typeName, null, getFInfoFilter, maxFeatures,

propertyNames, null);

and I suspect that the maxFeatures variable that is used in creating the query q is used to limit the number of features returned by the getFeatures method.

And if the rules of the SLD are applied afterwards as a postFilter, the number of features actually returned by the GetFeatureInfo request may be lower than maxFeatures.

I will attempt to recreate the problem in a test environment and if I succeed I will post the results here.

/ Johan

···

On Tue, Nov 26, 2013 at 2:48 PM, Johan Behrenfeldt <johan.behrenfeldt@anonymised.com> wrote:

Hi,

My mistake! Of course, I should’ve included that piece of information.

The version in which I encountered my problem is 2.1.3 (subversion: revision 16668).

If I look at the GEOS-5377 ticket, I can see that was fixed in version 2.2.2 and upgrading to version 2.2.2 or later may solve my problem. However, this is an issue that I’ve encountered in a production environment where I cannot upgrade GeoServer without going through a long process and I would want to be rather certain that the upgrade will fix my problem before going through that process.

Is there any way I can see what code changes were made to resolve the ticket? Seeing what code was changed to fix the ticket would give me a chance to make a qualified guess whether my problem has been solved or not.

Aaah… See, that makes it very easy to answer:

https://github.com/geoserver/geoserver/commit/9f159ded4f0c8da8c3742bdbdbb2463b9cf42a10

and as a patch:

https://github.com/geoserver/geoserver/commit/9f159ded4f0c8da8c3742bdbdbb2463b9cf42a10.patch

Cheers

Andrea

==

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

==

Ing. Andrea Aime

@geowolf

Technical Lead

GeoSolutions S.A.S.

Via Poggio alle Viti 1187

55054 Massarosa (LU)

Italy

phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it

http://twitter.com/geosolutions_it