From dcfa0b655c9e0a198bdf9e2b3106df84dd70d3ba Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 4 Jun 2015 07:45:44 -0700 Subject: [PATCH] fix #2863 by adding back compatibility of point symbolizer interior placement on point geometries + update visual tests --- .../renderer_common/process_point_symbolizer.hpp | 12 ++++++++++-- test/data-visual | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/mapnik/renderer_common/process_point_symbolizer.hpp b/include/mapnik/renderer_common/process_point_symbolizer.hpp index 4ba56f49e..a67943752 100644 --- a/include/mapnik/renderer_common/process_point_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_point_symbolizer.hpp @@ -69,17 +69,25 @@ void render_point_symbolizer(point_symbolizer const &sym, mapnik::geometry::geometry const& geometry = feature.get_geometry(); mapnik::geometry::point pt; - if (placement == CENTROID_POINT_PLACEMENT) + geometry::geometry_types type = geometry::geometry_type(geometry); + if (placement == CENTROID_POINT_PLACEMENT || + type == geometry::geometry_types::Point || + type == geometry::geometry_types::MultiPoint) { if (!geometry::centroid(geometry, pt)) return; } - else if (mapnik::geometry::geometry_type(geometry) == mapnik::geometry::geometry_types::Polygon) + else if (type == mapnik::geometry::geometry_types::Polygon) { auto const& poly = mapnik::util::get >(geometry); geometry::polygon_vertex_adapter va(poly); if (!label::interior_position(va ,pt.x, pt.y)) return; } + else + { + MAPNIK_LOG_WARN(point_symbolizer) << "TODO: unhandled geometry type for point symbolizer"; + return; + } double x = pt.x; double y = pt.y; double z = 0; diff --git a/test/data-visual b/test/data-visual index 9a61f97da..1bcc32385 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit 9a61f97dacf47f33538078a50b52122947d31caf +Subproject commit 1bcc3238531761998109f8ee7951c2cd411b746a