use boost::make_shared feature factory for ogr featuresets

This commit is contained in:
Dane Springmeyer 2011-05-18 01:28:22 +00:00
parent cb3ba2c193
commit ca90c34d17
2 changed files with 8 additions and 4 deletions

View file

@ -29,6 +29,7 @@
#include <mapnik/feature_layer_desc.hpp>
#include <mapnik/wkb.hpp>
#include <mapnik/unicode.hpp>
#include <mapnik/feature_factory.hpp>
// 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())

View file

@ -31,6 +31,7 @@
#include <mapnik/wkb.hpp>
#include <mapnik/unicode.hpp>
#include <mapnik/mapped_memory_cache.hpp>
#include <mapnik/feature_factory.hpp>
// boost
#include <boost/interprocess/streams/bufferstream.hpp>
@ -48,6 +49,7 @@ using mapnik::Feature;
using mapnik::feature_ptr;
using mapnik::geometry_utils;
using mapnik::transcoder;
using mapnik::feature_factory;
template <typename filterT>
ogr_index_featureset<filterT>::ogr_index_featureset(OGRDataSource & dataset,
@ -61,7 +63,7 @@ ogr_index_featureset<filterT>::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<filterT>::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())