From 32e2a26dcad4374c61e3691ba899506f31f4d1f2 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 17 Jan 2012 09:58:45 -0500 Subject: [PATCH 1/3] remove mapnik::point_datasource from c++ and mapnik.PointDatasource from python bindings --- CHANGELOG | 2 ++ bindings/python/mapnik/__init__.py | 1 - bindings/python/mapnik_datasource.cpp | 6 ------ include/mapnik/memory_datasource.hpp | 17 +---------------- src/memory_datasource.cpp | 16 ---------------- 5 files changed, 3 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 49aa4e399..caa88a4ad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,8 @@ For a complete change history, see the SVN log. Mapnik 2.1.0 ------------ +- Removed PointDatasource - use more robust MemoryDatasource instead (#1032) + - SQLite - Added support for !intersects! token in sql subselects (#809) allow custom positioning of rtree spatial filter. - New CSV plugin - reads tabular files - autodetecting geo columns, newlines, and delimiters. Uses in-memory featureset for fast rendering and is not designed for large files (#902) diff --git a/bindings/python/mapnik/__init__.py b/bindings/python/mapnik/__init__.py index 66d884bc7..cd8634c01 100644 --- a/bindings/python/mapnik/__init__.py +++ b/bindings/python/mapnik/__init__.py @@ -667,7 +667,6 @@ __all__ = [ 'Path', 'Parameter', 'Parameters', - 'PointDatasource', 'PointSymbolizer', 'PolygonPatternSymbolizer', 'PolygonSymbolizer', diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp index e607f1327..fdb127acd 100644 --- a/bindings/python/mapnik_datasource.cpp +++ b/bindings/python/mapnik_datasource.cpp @@ -36,7 +36,6 @@ using mapnik::datasource; -using mapnik::point_datasource; using mapnik::memory_datasource; using mapnik::layer_descriptor; using mapnik::attribute_descriptor; @@ -182,11 +181,6 @@ void export_datasource() def("Describe",&describe); def("CreateDatasource",&create_datasource); - class_, boost::noncopyable>("PointDatasource", init<>()) - .def("add_point",&point_datasource::add_point) - ; - - class_, boost::noncopyable>("MemoryDatasource", init<>()) .def("add_feature",&memory_datasource::push, "Adds a Feature:\n" diff --git a/include/mapnik/memory_datasource.hpp b/include/mapnik/memory_datasource.hpp index 55edc8227..8b665774f 100644 --- a/include/mapnik/memory_datasource.hpp +++ b/include/mapnik/memory_datasource.hpp @@ -49,22 +49,7 @@ public: private: std::vector features_; mapnik::layer_descriptor desc_; -}; - -// This class implements a simple way of displaying point-based data -// TODO -- possible redesign, move into separate file -// - -class MAPNIK_DECL point_datasource : public memory_datasource { -public: - point_datasource() : - feature_id_(1) {} - void add_point(double x, double y, const char* key, const char* value); - inline int type() const { return datasource::Vector; } - -private: - int feature_id_; -}; +}; } #endif // MAPNIK_MEMORY_DATASOURCE_HPP diff --git a/src/memory_datasource.cpp b/src/memory_datasource.cpp index 4ff0c776c..786536be2 100644 --- a/src/memory_datasource.cpp +++ b/src/memory_datasource.cpp @@ -112,20 +112,4 @@ void memory_datasource::clear() features_.clear(); } -// point_datasource - -void point_datasource::add_point(double x, double y, const char* key, const char* value) -{ - // FIXME - - //feature_ptr feature(feature_factory::create(feature_id_)); - // ++feature_id_; - // geometry_type * pt = new geometry_type(Point); - // pt->move_to(x,y); - // feature->add_geometry(pt); - // transcoder tr("utf-8"); - // (*feature)[key] = tr.transcode(value); - // this->push(feature); -} - } From 3e4bbcbf83c2654815eb52a18267913c52a584c7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 17 Jan 2012 10:06:59 -0500 Subject: [PATCH 2/3] remove unused shx code --- plugins/input/shape/shape_io.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/plugins/input/shape/shape_io.cpp b/plugins/input/shape/shape_io.cpp index 1fc570c24..939fe97e6 100644 --- a/plugins/input/shape/shape_io.cpp +++ b/plugins/input/shape/shape_io.cpp @@ -94,13 +94,6 @@ shape_file& shape_io::shp() return shp_; } -#if 0 -shape_file& shape_io::shx() -{ - return shx_; -} -#endif - dbf_file& shape_io::dbf() { return dbf_; From bef2bda067a5aae11ed88d8a84cc24c6a7dbafc7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 17 Jan 2012 10:56:59 -0500 Subject: [PATCH 3/3] use std::size_t for mapnik::context mapping type --- include/mapnik/feature.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 0dfbf0424..e3bec8286 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -46,7 +46,7 @@ namespace mapnik { typedef boost::shared_ptr raster_ptr; -typedef std::map map_type; +typedef std::map map_type; typedef boost::associative_property_map base_type; class feature_impl; @@ -85,8 +85,7 @@ class feature_impl : private boost::noncopyable { friend class feature_kv_iterator; public: - - + typedef mapnik::value value_type; typedef std::vector cont_type;