[Thuban-commits] r2688 - in trunk/thuban: . Doc/manual Resources/XML Thuban/Model Thuban/UI test

Bernhard Herzog bh at intevation.de
Fri Jun 30 15:23:10 CEST 2006


scm-commit at wald.intevation.org writes:

> New Classification "Pattern": Classify text attributes by regexp.

Nice.  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]).

[1] OGC 02-070, Styled Layer Descriptor Implementation Specification
[2] OGC 02-059, Filter Encoding Implementation Specification, section 9.


> 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)*)>

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.

> +class ClassGroupPattern(ClassGroup):
[...]
> +    def __repr__(self): 
> +        return "(" + repr(self.__pattern) + ", " + ClassGroup.__repr__(self) + ")"

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.


> Modified: trunk/thuban/test/test_classification.py
> +        s = ClassGroupPattern("A")
[...]
> +        self.clazz.AppendGroup(ClassGroupPattern("B"))
[...]
> Modified: trunk/thuban/test/test_layer.py
> +        classification.AppendGroup(ClassGroupPattern("I"))
[...]
> Modified: trunk/thuban/test/test_load.py
[...]
> +                <clpattern label="" pattern="BUI">
[...]
> Modified: trunk/thuban/test/test_save.py
[...]
> +        # Pattern
> +        clazz.AppendGroup(ClassGroupPattern("BUI", ClassGroupProperties(),
> +                                            "pattern")) 

Shouldn't at least one test actually use a regular expression that's not
the same as a string equality test?

   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                           http://skencil.org/
Thuban                                  http://thuban.intevation.org/




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)