c++11 compile fixes

This commit is contained in:
Dane Springmeyer 2013-10-22 16:05:44 -04:00
parent 043f52d0a6
commit afd23586f3
5 changed files with 36 additions and 31 deletions

View file

@ -259,7 +259,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
SDOPointType* sdopoint = geom->getSdo_point();
if (sdopoint && ! sdopoint->isNull())
{
geometry_type* point = new geometry_type(mapnik::Point);
geometry_type* point = new geometry_type(mapnik::geometry_type::types::Point);
point->move_to(sdopoint->getX(), sdopoint->getY());
feature->add_geometry(point);
}
@ -272,7 +272,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
const bool is_single_geom = true;
const bool is_point_type = false;
convert_ordinates(feature,
mapnik::LineString,
mapnik::geometry_type::types::LineString,
elem_info,
ordinates,
dimensions,
@ -288,7 +288,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
const bool is_single_geom = true;
const bool is_point_type = false;
convert_ordinates(feature,
mapnik::Polygon,
mapnik::geometry_type::types::Polygon,
elem_info,
ordinates,
dimensions,
@ -304,7 +304,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
const bool is_single_geom = false;
const bool is_point_type = true;
convert_ordinates(feature,
mapnik::Point,
mapnik::geometry_type::types::Point,
elem_info,
ordinates,
dimensions,
@ -321,7 +321,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
const bool is_point_type = false;
convert_ordinates(feature,
mapnik::LineString,
mapnik::geometry_type::types::LineString,
elem_info,
ordinates,
dimensions,
@ -338,7 +338,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
const bool is_point_type = false;
convert_ordinates(feature,
mapnik::Polygon,
mapnik::geometry_type::types::Polygon,
elem_info,
ordinates,
dimensions,
@ -356,7 +356,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
const bool is_point_type = false;
convert_ordinates(feature,
mapnik::Polygon,
mapnik::geometry_type::types::Polygon,
elem_info,
ordinates,
dimensions,
@ -377,7 +377,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature)
}
void occi_featureset::convert_ordinates(mapnik::feature_ptr feature,
const mapnik::geometry::types& geom_type,
const mapnik::geometry_type::types& geom_type,
const std::vector<Number>& elem_info,
const std::vector<Number>& ordinates,
const int dimensions,
@ -404,20 +404,20 @@ void occi_featureset::convert_ordinates(mapnik::feature_ptr feature,
int next_interp = elem_info[i + 2];
bool is_linear_element = true;
bool is_unknown_etype = false;
mapnik::geometry::types gtype = mapnik::Point;
mapnik::geometry_type::types gtype = mapnik::geometry_type::types::Point;
switch (etype)
{
case SDO_ETYPE_POINT:
if (interp == SDO_INTERPRETATION_POINT) {}
if (interp > SDO_INTERPRETATION_POINT) {}
gtype = mapnik::Point;
gtype = mapnik::geometry_type::types::Point;
break;
case SDO_ETYPE_LINESTRING:
if (interp == SDO_INTERPRETATION_STRAIGHT) {}
if (interp == SDO_INTERPRETATION_CIRCULAR) {}
gtype = mapnik::LineString;
gtype = mapnik::geometry_type::types::LineString;
break;
case SDO_ETYPE_POLYGON:
@ -426,7 +426,7 @@ void occi_featureset::convert_ordinates(mapnik::feature_ptr feature,
if (interp == SDO_INTERPRETATION_CIRCULAR) {}
if (interp == SDO_INTERPRETATION_RECTANGLE) {}
if (interp == SDO_INTERPRETATION_CIRCLE) {}
gtype = mapnik::Polygon;
gtype = mapnik::geometry_type::types::Polygon;
break;
case SDO_ETYPE_COMPOUND_LINESTRING:
@ -434,7 +434,7 @@ void occi_featureset::convert_ordinates(mapnik::feature_ptr feature,
case SDO_ETYPE_COMPOUND_POLYGON_INTERIOR:
// interp = next ETYPE to consider
is_linear_element = false;
gtype = mapnik::Polygon;
gtype = mapnik::geometry_type::types::Polygon;
break;
case SDO_ETYPE_UNKNOWN: // unknown

View file

@ -55,7 +55,7 @@ public:
private:
void convert_geometry (SDOGeometry* geom, mapnik::feature_ptr feature);
void convert_ordinates (mapnik::feature_ptr feature,
const mapnik::geometry::types& geom_type,
const mapnik::geometry_type::types& geom_type,
const std::vector<oracle::occi::Number>& elem_info,
const std::vector<oracle::occi::Number>& ordinates,
const int dimensions,

View file

@ -65,21 +65,8 @@ feature_ptr rasterlite_featureset::next()
if (first_)
{
first_ = false;
query *q = std::get<query>(&gquery_);
if (q)
{
return get_feature(*q);
}
else
{
coord2d *p = std::get<coord2d>(&gquery_);
if (p)
{
return get_feature_at_point(*p);
}
}
// should never reach here
MAPNIK_LOG_DEBUG(gdal) << "rasterlite_featureset: Next feature in Dataset=" << &dataset_;
return boost::apply_visitor(query_dispatch(*this), gquery_);
}
return feature_ptr();
}

View file

@ -37,6 +37,24 @@ typedef boost::variant<mapnik::query,mapnik::coord2d> rasterlite_query;
class rasterlite_featureset : public mapnik::Featureset
{
struct query_dispatch : public boost::static_visitor<mapnik::feature_ptr>
{
query_dispatch( rasterlite_featureset & featureset)
: featureset_(featureset) {}
mapnik::feature_ptr operator() (mapnik::query const& q) const
{
return featureset_.get_feature(q);
}
mapnik::feature_ptr operator() (mapnik::coord2d const& p) const
{
return featureset_.get_feature_at_point(p);
}
rasterlite_featureset & featureset_;
};
public:
rasterlite_featureset(void* dataset,
rasterlite_query q);

View file

@ -41,7 +41,7 @@ mapnik::feature_ptr hello_featureset::next()
mapnik::coord2d center = box_.center();
// create a new point geometry
mapnik::geometry_type * pt = new mapnik::geometry_type(mapnik::Point);
mapnik::geometry_type * pt = new mapnik::geometry_type(mapnik::geometry_type::types::Point);
// we use path type geometries in Mapnik to fit nicely with AGG and Cairo
// here we stick an x,y pair into the geometry using move_to()
@ -53,7 +53,7 @@ mapnik::feature_ptr hello_featureset::next()
// A feature usually will have just one geometry of a given type
// but mapnik does support many geometries per feature of any type
// so here we draw a line around the point
mapnik::geometry_type * line = new mapnik::geometry_type(mapnik::LineString);
mapnik::geometry_type * line = new mapnik::geometry_type(mapnik::geometry_type::types::LineString);
line->move_to(box_.minx(),box_.miny());
line->line_to(box_.minx(),box_.maxy());
line->line_to(box_.maxx(),box_.maxy());