question on Filters
I ran into an issue when trying to render a test map (python + xml) from a postgis db with filters in place. I'm not sure if this is by design or a bug, so i thought i'd post and ask so i can stop scratching my head over it.
If a filter field is not found in the source database, is it supposed to cause mapnik to abort rendering that entire layer? or should it just ignore that filter and move on to the next?
Let me elaborate a bit:
Lets say i have a database with only 3 fields: "name", "leisure", and "landuse". If i try to run mapnik with a filter that doesn't exist, or is misspelled, like..."land_usage", i get a blank map...thus skipping all other filters that are correct. If i take that one filter out, then everything else gets rendered normal again.
Here's my working xml example (it draws all 3 requested things):
<Rule>
<Filter>[landuse] = 'farm'</Filter>
<MaxScaleDenominator>1000000</MaxScaleDenominator>
<PolygonSymbolizer>
<CssParameter name="fill">#ead8bd</CssParameter>
</PolygonSymbolizer>
</Rule>
<Rule>
<Filter>[leisure] = 'park'</Filter>
<MaxScaleDenominator>1000000</MaxScaleDenominator>
<PolygonSymbolizer>
<CssParameter name="fill">#b6fdb6</CssParameter>
</PolygonSymbolizer>
</Rule>
<Rule>
<Filter>[leisure] = 'golf_course'</Filter>
<MaxScaleDenominator>1000000</MaxScaleDenominator>
<PolygonSymbolizer>
<CssParameter name="fill">#b5e3b5</CssParameter>
</PolygonSymbolizer>
</Rule>
Here's my NON-working xml example (It draws nothing at all. Not even the correct filters):
<Rule>
<Filter>[land_usage] = 'farm'</Filter>
<MaxScaleDenominator>1000000</MaxScaleDenominator>
<PolygonSymbolizer>
<CssParameter name="fill">#ead8bd</CssParameter>
</PolygonSymbolizer>
</Rule>
<Rule>
<Filter>[leisure] = 'park'</Filter>
<MaxScaleDenominator>1000000</MaxScaleDenominator>
<PolygonSymbolizer>
<CssParameter name="fill">#b6fdb6</CssParameter>
</PolygonSymbolizer>
</Rule>
<Rule>
<Filter>[leisure] = 'golf_course'</Filter>
<MaxScaleDenominator>1000000</MaxScaleDenominator>
<PolygonSymbolizer>
<CssParameter name="fill">#b5e3b5</CssParameter>
</PolygonSymbolizer>
</Rule>
The obvious "fix" to this, is to always make sure every single filter field exists is spelled correctly, but as the xml grows, it's harder and harder to track. Again, just wondering if this is a bug or just the way that filters are supposed to work.
Thanks in advance,
-will