Merge branch 'master' of github.com:mapnik/mapnik

This commit is contained in:
Dane Springmeyer 2013-10-23 15:42:39 -07:00
commit efb687eb0b
44 changed files with 18 additions and 22 deletions

View file

@ -213,8 +213,7 @@ mapnik::featureset_ptr geojson_datasource::features(mapnik::query const& q) cons
if (extent_.intersects(b))
{
box_type box(point_type(b.minx(),b.miny()),point_type(b.maxx(),b.maxy()));
index_array_ = tree_.find(box);
return std::make_shared<geojson_featureset>(features_, index_array_.begin(), index_array_.end());
return std::make_shared<geojson_featureset>(features_, tree_.find(box));
}
// otherwise return an empty featureset pointer
return mapnik::featureset_ptr();

View file

@ -74,7 +74,6 @@ private:
std::shared_ptr<mapnik::transcoder> tr_;
std::vector<mapnik::feature_ptr> features_;
spatial_index_type tree_;
mutable std::deque<std::size_t> index_array_;
};

View file

@ -29,12 +29,12 @@
#include "geojson_featureset.hpp"
geojson_featureset::geojson_featureset(std::vector<mapnik::feature_ptr> const& features,
std::deque<std::size_t>::const_iterator index_itr,
std::deque<std::size_t>::const_iterator index_end)
geojson_featureset::geojson_featureset(std::vector<mapnik::feature_ptr> const& features,
std::deque<std::size_t> && index_array)
: features_(features),
index_itr_(index_itr),
index_end_(index_end) {}
index_array_(std::move(index_array)),
index_itr_(index_array_.begin()),
index_end_(index_array_.end()) {}
geojson_featureset::~geojson_featureset() {}
@ -42,11 +42,11 @@ mapnik::feature_ptr geojson_featureset::next()
{
if (index_itr_ != index_end_)
{
std::size_t index = *index_itr_++;
std::size_t index = *index_itr_++;
if ( index < features_.size())
{
return features_.at(index);
}
}
}
return mapnik::feature_ptr();
}

View file

@ -34,14 +34,13 @@ class geojson_featureset : public mapnik::Featureset
{
public:
geojson_featureset(std::vector<mapnik::feature_ptr> const& features,
std::deque<std::size_t>::const_iterator index_itr,
std::deque<std::size_t>::const_iterator index_end);
std::deque<std::size_t> && index_array);
virtual ~geojson_featureset();
mapnik::feature_ptr next();
private:
mapnik::box2d<double> box_;
std::vector<mapnik::feature_ptr> const& features_;
const std::deque<std::size_t> index_array_;
std::deque<std::size_t>::const_iterator index_itr_;
std::deque<std::size_t>::const_iterator index_end_;
};

View file

@ -145,8 +145,7 @@ mapnik::featureset_ptr topojson_datasource::features(mapnik::query const& q) con
if (extent_.intersects(b))
{
box_type box(point_type(b.minx(),b.miny()),point_type(b.maxx(),b.maxy()));
index_array_ = tree_.find(box);
return std::make_shared<topojson_featureset>(topo_, *tr_, index_array_.begin(), index_array_.end());
return std::make_shared<topojson_featureset>(topo_, *tr_, tree_.find(box));
}
// otherwise return an empty featureset pointer
return mapnik::featureset_ptr();

View file

@ -74,7 +74,6 @@ private:
std::shared_ptr<mapnik::transcoder> tr_;
mapnik::topojson::topology topo_;
spatial_index_type tree_;
mutable std::deque<std::size_t> index_array_;
};

View file

@ -353,13 +353,13 @@ struct feature_generator : public boost::static_visitor<mapnik::feature_ptr>
topojson_featureset::topojson_featureset(mapnik::topojson::topology const& topo,
mapnik::transcoder const& tr,
std::deque<std::size_t>::const_iterator index_itr,
std::deque<std::size_t>::const_iterator index_end)
std::deque<std::size_t> && index_array)
: ctx_(std::make_shared<mapnik::context_type>()),
topo_(topo),
tr_(tr),
index_itr_(index_itr),
index_end_(index_end),
index_array_(std::move(index_array)),
index_itr_(index_array_.begin()),
index_end_(index_array_.end()),
feature_id_ (0) {}
topojson_featureset::~topojson_featureset() {}

View file

@ -34,8 +34,8 @@ class topojson_featureset : public mapnik::Featureset
public:
topojson_featureset(mapnik::topojson::topology const& topo,
mapnik::transcoder const& tr,
std::deque<std::size_t>::const_iterator index_itr,
std::deque<std::size_t>::const_iterator index_end);
std::deque<std::size_t> && index_array);
virtual ~topojson_featureset();
mapnik::feature_ptr next();
@ -44,6 +44,7 @@ private:
mapnik::box2d<double> box_;
mapnik::topojson::topology const& topo_;
mapnik::transcoder const& tr_;
const std::deque<std::size_t> index_array_;
std::deque<std::size_t>::const_iterator index_itr_;
std::deque<std::size_t>::const_iterator index_end_;
std::size_t feature_id_;

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB