add basic support for point_symbolizer and mapnik::new_geometry::point

This commit is contained in:
artemp 2015-02-19 10:45:03 +01:00
parent 33d45db318
commit 42983ff015

View file

@ -63,26 +63,30 @@ void render_point_symbolizer(point_symbolizer const &sym,
agg::trans_affine recenter_tr = recenter * tr; agg::trans_affine recenter_tr = recenter * tr;
box2d<double> label_ext = bbox * recenter_tr * agg::trans_affine_scaling(common.scale_factor_); box2d<double> label_ext = bbox * recenter_tr * agg::trans_affine_scaling(common.scale_factor_);
// FIXME // FIXME - refactor and support other than point geometry
/*
for (std::size_t i=0; i<feature.num_geometries(); ++i)
{
geometry_type const& geom = feature.get_geometry(i);
vertex_adapter va(geom);
double x;
double y;
double z=0;
if (placement == CENTROID_POINT_PLACEMENT)
{
if (!label::centroid(va, x, y))
return;
}
else
{
if (!label::interior_position(va ,x, y))
return;
}
mapnik::new_geometry::geometry const& geometry = feature.get_geometry();
if (geometry.is<mapnik::new_geometry::point>())
{
mapnik::new_geometry::point const& point = mapnik::util::get<mapnik::new_geometry::point>(geometry);
//mapnik::new_geometry::point_vertex_adapter va(point);
//double x;
//double y;
//double z=0;
//if (placement == CENTROID_POINT_PLACEMENT)
//{
// if (!label::centroid(va, x, y))
// return;
//}
//else
//{
// if (!label::interior_position(va ,x, y))
// return;
//}
double x = point.x;
double y = point.y;
double z = 0;
prj_trans.backward(x,y,z); prj_trans.backward(x,y,z);
common.t_.forward(&x,&y); common.t_.forward(&x,&y);
label_ext.re_center(x,y); label_ext.re_center(x,y);
@ -99,7 +103,6 @@ void render_point_symbolizer(point_symbolizer const &sym,
common.detector_->insert(label_ext); common.detector_->insert(label_ext);
} }
} }
*/
} }
} }