[Community] On the way to 0.6: two more things

Ludwig Max Brinckmann ludwigbrinckmann at gmail.com
Mon Jun 26 20:26:08 EEST 2006


1) I think the GeoAwareObjects package still needs to be brought in line
with the new interfaces, changing the old __implements__ notation to
implements(IGeoAware) plus including an from zope.interface import
implements line at the top.
The only thing then not working is in GPSTrack the setAlternative method,
which I did not investigate, the original authors will probably fix it in a
second.

2) Rules: I am trying to do the following: for the provincial capital I have
a way to render the symbolizers small when the mapscale is large, and larger
when the scale is small to better distinguish it from other places.

I am scripting this like this:

places.addStyleRule(name='Provincial Capital',
                    max_scale = -1,
                    min_scale = 4000000,
                   filter_expr='str(f.KIND) == "provincialcapital"',
                   symbolizers=[ places.provincialcapital.UID(),
places.textsmall.UID()])

places.addStyleRule(name='Provincial capital',
                   min_scale = -1,
                   max_scale = 4000000,
                   filter_expr='str(f.KIND) == "provincialcapital"',
                   symbolizers=[ places.provincialcapitallarge.UID(),
places.textlarge.UID()])

(note the spelling of Provincial _C_apital with lower/upper case C to get
around the fact I cannot have different rules with the same name - not so
good as this shows up in the legend (it would be better to have a legend
display separate from the rule name).)

So I would expect this to work that at scale 1:5000000 the smaller dot and
smaller text is displayed, while at 1:3000000 the larger dot and larger text
appears. Each individual of these rules work fine in isolation.

But having both rules there at the same time actually makes the
large symbolizers appear at large scale (which it shouldn't, the small dot
and text should appear) and nothing to appear at scale e.g. 1:3000000.

Separating the text and point symbolizers out does not solve the problem:

places.addStyleRule(name='Provincial CapitalT',
                    max_scale = -1,
                    min_scale = 4000000,
                   filter_expr='str(f.KIND) == "provincialcapital"',
                   symbolizers=[ places.textsmall.UID()])

places.addStyleRule(name='Provincial Capital',
                    max_scale = -1,
                    min_scale = 4000000,
                   filter_expr='str(f.KIND) == "provincialcapital"',
                   symbolizers=[ places.provincialcapital.UID()])

places.addStyleRule(name='Provincial capitalT',
                   min_scale = -1,
                   max_scale = 4000000,
                   filter_expr='str(f.KIND) == "provincialcapital"',
                   symbolizers=[ places.textlarge.UID()])

places.addStyleRule(name='Provincial capital',
                   min_scale = -1,
                   max_scale = 4000000,
                   filter_expr='str(f.KIND) == "provincialcapital"',
                   symbolizers=[ places.provincialcapitallarge.UID()])

I have tried a similar thing with line symbolizers (motorways first visible
as small double lines in a large scale map, with divider on a smaller scale)
and it produces the same result.

Something is getting confused here (I hope its not me -- but I have now
(finally!) my entire map scripted, so I am much quicker to reproduce any
errors.)

Ludwig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gispython.org/pipermail/community/attachments/20060626/35a40887/attachment.htm>


More information about the Community mailing list