From ca90c34d176952551f25cf6da222e6796add3edd Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 18 May 2011 01:28:22 +0000 Subject: [PATCH] use boost::make_shared feature factory for ogr featuresets --- plugins/input/ogr/ogr_featureset.cpp | 6 ++++-- plugins/input/ogr/ogr_index_featureset.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/input/ogr/ogr_featureset.cpp b/plugins/input/ogr/ogr_featureset.cpp index fa8b882a2..3ea72a106 100644 --- a/plugins/input/ogr/ogr_featureset.cpp +++ b/plugins/input/ogr/ogr_featureset.cpp @@ -29,6 +29,7 @@ #include #include #include +#include // ogr #include "ogr_featureset.hpp" @@ -42,6 +43,7 @@ using mapnik::Feature; using mapnik::feature_ptr; using mapnik::geometry_utils; using mapnik::transcoder; +using mapnik::feature_factory; ogr_featureset::ogr_featureset(OGRDataSource & dataset, @@ -69,7 +71,7 @@ ogr_featureset::ogr_featureset(OGRDataSource & dataset, layer_(layer), layerdef_(layer.GetLayerDefn()), tr_(new transcoder(encoding)), - fidcolumn_(layer_.GetFIDColumn ()), + fidcolumn_(layer_.GetFIDColumn()), multiple_geometries_(multiple_geometries), count_(0) { @@ -89,7 +91,7 @@ feature_ptr ogr_featureset::next() // ogr feature ids start at 0, so add one to stay // consistent with other mapnik datasources that start at 1 int feature_id = ((*feat)->GetFID() + 1); - feature_ptr feature(new Feature(feature_id)); + feature_ptr feature(feature_factory::create(feature_id)); OGRGeometry* geom=(*feat)->GetGeometryRef(); if (geom && !geom->IsEmpty()) diff --git a/plugins/input/ogr/ogr_index_featureset.cpp b/plugins/input/ogr/ogr_index_featureset.cpp index d9af1c25f..407578ad4 100644 --- a/plugins/input/ogr/ogr_index_featureset.cpp +++ b/plugins/input/ogr/ogr_index_featureset.cpp @@ -31,6 +31,7 @@ #include #include #include +#include // boost #include @@ -48,6 +49,7 @@ using mapnik::Feature; using mapnik::feature_ptr; using mapnik::geometry_utils; using mapnik::transcoder; +using mapnik::feature_factory; template ogr_index_featureset::ogr_index_featureset(OGRDataSource & dataset, @@ -61,7 +63,7 @@ ogr_index_featureset::ogr_index_featureset(OGRDataSource & dataset, layerdef_(layer.GetLayerDefn()), filter_(filter), tr_(new transcoder(encoding)), - fidcolumn_(layer_.GetFIDColumn ()), + fidcolumn_(layer_.GetFIDColumn()), multiple_geometries_(multiple_geometries) { @@ -101,7 +103,7 @@ feature_ptr ogr_index_featureset::next() // ogr feature ids start at 0, so add one to stay // consistent with other mapnik datasources that start at 1 int feature_id = ((*feat)->GetFID() + 1); - feature_ptr feature(new Feature(feature_id)); + feature_ptr feature(feature_factory::create(feature_id)); OGRGeometry* geom=(*feat)->GetGeometryRef(); if (geom && !geom->IsEmpty())