Thanks for the reply... see commentes below:
On 22/06/2012 11:13, Andrea Aime wrote:
>
> f = filterFactory2.like(filterFactory2.property("myProperty"),
> "findMe");
> In the examples/documentation the wildcard is given as "%" however
> it appears to be impletmented as ".?" and ".*".
>
> Hum, afaik the defaults are * and ? (without the dots), that's what we
> have around in the tests at least.
> Some tests are also explicit and have a pattern like:
>
> PropertyIsLike caseSensitiveLike =
> ff.like(ff.property(aname("stringProperty")), "Z*", "*", "?", "\\", true);
I've had a look into this again, I think I got misled looking at this one:
// pattern based "like" filter
filter = ff.like(ff.property("code"), "2300%");
// you can customise the wildcard characters used
filter = ff.like(ff.property("code"), "2300?", "*", "?", "\\");
> Also, the filter only evaluates as true on a full match of the
> input string e.g. Matcher.matches() method. I can't get a filter
> to work so that I can select features based on if a property
> containing a string, e.g.
>
> myFeature.myProperty= "abcFindMedef"
>
> with the filter:
>
> like(filterFactory2.property("myProperty"), ".*findMe.*");
>
> I know this works against database data, what data source are you using?
>
I'm reading data from a KML file into MemoryStore. I think the problem
lies in that I'm using the "description" property and this has some '\n'
characters which confuses things. The following works, but not on my
description property:
filterFactory.like(filterFactory.property("name"), "*56*");
Cheers,
Mark
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users