From 822531a114a82090284139716706270c7b4a2949 Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 30 Jul 2012 18:32:42 +0100 Subject: [PATCH] + filter on geometry type to use centroid (Polygon) or middle_point (LineString) label placement --- src/symbolizer_helpers.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/symbolizer_helpers.cpp b/src/symbolizer_helpers.cpp index 1cf014bb9..85a917787 100644 --- a/src/symbolizer_helpers.cpp +++ b/src/symbolizer_helpers.cpp @@ -244,7 +244,14 @@ void text_symbolizer_helper::initialize_points() { if (how_placed == POINT_PLACEMENT) { - label::centroid(geom, label_x, label_y); + if (geom.type() == Polygon) + { + label::centroid(geom, label_x, label_y); + } + else if (geom.type() == LineString) + { + label::middle_point(geom, label_x,label_y); + } } else if (how_placed == INTERIOR_PLACEMENT) {