Ticket #369 (closed defect: fixed)
Filter Condition String Whitespace is Stripped
| Reported by: | icio | Owned by: | artem |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.6.1 |
| Component: | Core Library | Version: | 0.6.0 |
| Severity: | Normal | Keywords: | filter whitespace |
| Cc: | Patch Needs Improvement: | no | |
| Needs Docmentation: | no | Has Patch?: | no |
| Design Decision Needed: | no |
Description
Problem
There is an indifference in the way that the strings in Filters and the strings from the datasource are handled.
With a filter object, whitespace is trimmed from the matching value:
>>> from mapnik import *
>>> filter = Filter("[name]='value '")
>>> print filter
([name]='value')
Whitespace is not trimmed from the data (the following examples were selected from a 'character' [not 'character varying'] column in a Postgres DB):
"Height Control " "Inland Water " "Political Or Administrative"
This results in filters not matching data it should.
Solution
There are two possible obvious solutions. Either the filter condition should not be trimmed or the data should be trimmed.
I propose trimming the data to conform with Quantum GIS which takes this approach and allow continued compatability with Quantumnik exports.
