Hi Rob,
2014-02-11 16:37 GMT+01:00 Rob van Swol <rob.van.s...@nlr.nl>: > Hi Mauro, > I am glad that you have taken the time to investigate this issue. Indeed > the PropertyIsLike filter as you present it is the expected result; I have > not tried many more filters (After and PropertyIsLike showed problems as > did some other time related filters.) PropertyIsEqualTo seemed to be ok. > Regards, > Rob > > Fine, I'm going to merge the patch for this tomorrow, if no one objects. >From what I saw in the code, problemating encoding could be present in filters that were not present in pre 2.0 version or changed their schema a bit. Mauro > > On 11-2-2014 12:21, Mauro Bartolomeoli wrote: > > Hi Rob, > > > 2014-02-06 9:22 GMT+01:00 Rob van Swol <rob.van.s...@nlr.nl>: > >> Hi, >> >> I am using geotools 10.4 en I am trying to encode a FES filter to XML. (I >> never had any problems with v1.1 OGC Filters). For example: encoding a >> PropertyIsLike filter results in (ValueReference and Literal are missong): >> <fes:Filter >> xmlns:fes="http://www.opengis.net/fes/2.0"<http://www.opengis.net/fes/2.0>xmlns:gml= >> "http://www.opengis.net/gml/3.2" <http://www.opengis.net/gml/3.2>> >> <fes:PropertyIsLike escapeChar="\" singleChar="?" wildCard="*"/> >> </fes:Filter> >> >> [created using : >> FilterFactory ff = CommonFactoryFinder.getFilterFactory2(); >> PropertyIsLikef = ff.like(ff.property("name"), "%piet%"); >> Configuration configuration = new >> org.geotools.filter.v2_0.FESConfiguration(); >> Encoder encoder = new org.geotools.xml.Encoder(configuration); >> encoder.encode(filter, org.geotools.filter.v2_0.FES.Filter, os); >> etc:] >> > > I tried to replicate your issue, and in effect it seems that there is a > bug in the 2.0 filters encoding. > > Is this the expected result? > > <?xml version="1.0" encoding="UTF-8"?> > <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml=" > http://www.opengis.net/gml/3.2"> > <fes:PropertyIsLike escapeChar="\" singleChar="?" wildCard="*"> > <fes:ValueReference>name</fes:ValueReference> > <fes:Literal>%piet%</fes:Literal> > </fes:PropertyIsLike> > </fes:Filter> > > If you can confirm I will submit a patch to solve this issue. > > >> >> Creating an AFTER filter (from an XML input) just results in: >> <fes:Filter >> xmlns:fes="http://www.opengis.net/fes/2.0"<http://www.opengis.net/fes/2.0>xmlns:gml= >> "http://www.opengis.net/gml/3.2" <http://www.opengis.net/gml/3.2>/> >> >> However, surrounding this AFTER with <fes:And> gives the expected result: >> <fes:Filter >> xmlns:fes="http://www.opengis.net/fes/2.0"<http://www.opengis.net/fes/2.0>xmlns:gml= >> "http://www.opengis.net/gml/3.2" <http://www.opengis.net/gml/3.2>> >> <fes:And> >> <fes:After> >> <fes:ValueReference>date</fes:ValueReference> >> <fes:Literal>1970-01-01T00:00:00Z</fes:Literal> >> </fes:After> >> </fes:And> >> </fes:Filter> >> > > Another bug, I'm afraid. > Tried the following snippet: > > FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); > Filter filter = ff.after(ff.property("date"), ff.literal(new > Date())); > org.geotools.filter.v2_0.FESConfiguration configuration = new > org.geotools.filter.v2_0.FESConfiguration(); > org.geotools.xml.Encoder encoder = new > org.geotools.xml.Encoder(configuration); > encoder.encode(filter, org.geotools.filter.v2_0.FES.Filter, os); > > I have a patch for this too, so going to submit a JIRA and a patch. > > Do you have any other 2.0 filter encoding issues? > > Mauro > > > -- > == > Our support, Your Success! Visit http://opensdi.geo-solutions.it for more > information. > == > > Dott. Mauro Bartolomeoli > @mauro_bart > Senior Software Engineer > > GeoSolutions S.A.S. > Via Poggio alle Viti 1187 > 55054 Massarosa (LU) > Italy > phone: +39 0584 962313 > fax: +39 0584 1660272 > > http://www.geo-solutions.it > http://twitter.com/geosolutions_it > > ------------------------------------------------------- > > > > -- > > National Aerospace Laboratory - *NLR* > > *Dr. R.W. (Rob) van Swol* > > *Senior Scientist Space Systems Department* > > Phone > +31 88 511 4252 > E-mail > rob.van.s...@nlr.nl > [image: NLR] > [image: NLR Dedicated to innovation in aerospace] > [image: Locations NLR] <http://www.nlr.nl/?id=8737> > > > > ------------------------------ > * The NLR disclaimer is valid for NLR e-mail messages.* > > This message is only meant for providing information. Nothing in this > e-mail message amounts to a contractual or legal commitment on the part of > the sender. > > This message may contain information that is not intended for you. If you > are not the addressee or if this message was sent to you by mistake, you > are requested to inform the sender and delete the message. Sender accepts > no liability for damage of any kind resulting from the risks inherent in > the electronic transmission of messages. > ------------------------------ > -- == Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information. == Dott. Mauro Bartolomeoli @mauro_bart Senior Software Engineer GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 http://www.geo-solutions.it http://twitter.com/geosolutions_it -------------------------------------------------------
<<nlr.gif>>
<<nlr_logo.gif>>
<<slogan.gif>>
------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel