[Thuban-commits] r2688 - in trunk/thuban: . Doc/manual Resources/XML Thuban/Model Thuban/UI test
Frank Koormann
frank.koormann at intevation.de
Mon Jul 3 11:22:02 CEST 2006
Am Freitag 30 Juni 2006 15:23 schrieb Bernhard Herzog:
> > New Classification "Pattern": Classify text attributes by regexp.
> Nice.
Thanks.
> However, do we really want full regular expression matches? I
> ask because we once thought about moving to Styled Layer Descriptor
> (SLD, [1]) syntax for the classifications. AFAICT regular expressions
> are not supported there. What SLD has, though is a simple wildcard
> matcher (PropertyIsLike, [2]).
Hm, SLD reads to be made for more or less static visualisation. Since Thuban
is a tool for interactive exploration of data I would miss on-the-fly
grouping like "[A-M].*". Following the SLD way I would have to preprocess the
data to add a (temp?) column
> > Modified: trunk/thuban/Resources/XML/thuban-1.1.dtd
> > -<!ELEMENT classification (clnull?, clpoint*, clrange*, clcont*)>
> > +<!ELEMENT classification (clnull?, clpoint*, clrange*, clpattern*,
> > clcont*)>
>
> There seems to be a bug in the DTD here. It should probably read
> <!ELEMENT classification (clnull?, (clpoint | clrange | clpattern |
> clcont)*)>
I simply extended the existing line. Someone with more knowledge on DTDs,
please comment and file a bug if necessary.
> BTW, does anyone know what clcont is supposed to mean? It only occurs
> in the DTD but nowhere in the code or tests and it has apparently been
> in the DTD ever since we had a DTD afaict.
No idea where this comes from. I think we should remove it.
> > +class ClassGroupPattern(ClassGroup):
> I would prefer a __repr__ that does not look like that of a tuple. It
> should make clear that it is the repr of an instance of
> ClassGroupPattern. This is a bug in all the classes in that module,
> though.
I added a bug and picked it up.
> > Modified: trunk/thuban/test/test_classification.py
> Shouldn't at least one test actually use a regular expression that's not
> the same as a string equality test?
It does test two times for "first character", not string equality:
| TestClassGroupPattern.test
| [...]
| group.SetPattern("A")
| self.assertEqual(group.GetPattern(), "A")
|
| # test Matches()
| self.assertEqual(group.Matches("CBA"), False)
| self.assertEqual(group.Matches("ABC"), True)
and
|TestClassification.test_multiple_groups_textual
| p = ClassGroupPattern("A")
| self.assertEquals(self.clazz.FindGroup("Abc"), p)
Regards,
Frank
--
Frank Koormann <frank.koormann at intevation.de>
Professional Service around Free Software (http://intevation.net/)
FreeGIS Project (http://freegis.org/)
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)