artemp/trac2github — Issue #88: ShieldSymbolizer on a point hangs mapnik
Author: artemp
Created: 2011-10-09 20:12:31+00:00
State: open
Labels: Core_Library

As posted to the list, using a ShieldSymboliser on a point hangs mapnik in agg::path_length. Attached are three patches, any two of which solve the problem:

patch1: This fixes the underlying problem. When a vertex is used as a VertexSource, it never returns an end-of-object marker and so loops forever. Since a vertex only has one point it should return END. Or should it return the point with MOVETO and then END. Someone needs to check this.

patch2: First the length is calculated and stored in total_distance, subsequently the variable distance is tested. I have no idea where this variable is defined, so I think it's a typo.

patch3: Given that I don't know if patch1 is correct, here is patch3, which adds a test to path_length to return 0 immediatly if there are only 0 or 1 nodes. But this requires adding a num_points function. I'm not sure if this is the right solution.
In the end I am unsure what is the right solution. Currently I use all the above and everything seems to be working fine.