unknown labeling position.

I think I got some of these errors after cropping a layer with labels, I
also changed this futher down in the file:

if pos == 'centroid' *and not (geometry is None):*
        pt = geometry.centroid
        return (pt.x, pt.y)
    else:
        raise KartographError('unknown label positioning mode ' + pos)

So the error occurs more often now, I guess

I feel a bit bad about just hiding the exceptions, but I do not know how to
handle it properly... (in some situations you get a lot of these errors

I was on a deadline when I did this, and I already had wasted some time
trying some other frameworks, so I went for a quickfix...

Just shared it in case it could be usefull...

Ulrik Einarson


On Fri, Feb 15, 2013 at 3:24 PM, gka <notifications@github.com> wrote:

> In kartograph/renderer/svg.py:
>
> > @@ -232,7 +232,11 @@ def _render_point(self, geometry):
> >      def _render_label(self, layer, feature, labelOpts):
> >          #if feature.geometry.area < 20:
> >          #    return
> > -        cx, cy = _get_label_position(feature.geometry, labelOpts['position'])
> > +        try:
> > +            cx, cy = _get_label_position(feature.geometry, labelOpts['position'])
> > +        except KartographError:
> > +            return
> > +
>
> what did the error say?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/kartograph/kartograph.py/pull/78/files#r3029193>.
>
>