From 4389c80d8455947ce3618557d38e43135444a6af Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 24 Mar 2015 14:21:28 +0100 Subject: [PATCH] and finaly, rename 'new_geometry' namespace to 'geometry' --- benchmark/test_polygon_clipping.cpp | 6 +- bindings/python/mapnik_geometry.cpp | 82 +++++++------- include/mapnik/feature.hpp | 12 +-- include/mapnik/geom_util.hpp | 6 +- include/mapnik/geometry.hpp | 2 +- include/mapnik/geometry_adapters.hpp | 100 +++++++++--------- include/mapnik/geometry_centroid.hpp | 4 +- include/mapnik/geometry_correct.hpp | 4 +- include/mapnik/geometry_empty.hpp | 20 ++-- include/mapnik/geometry_envelope.hpp | 26 ++--- include/mapnik/geometry_fusion_adapted.hpp | 8 +- include/mapnik/geometry_is_simple.hpp | 4 +- include/mapnik/geometry_is_valid.hpp | 4 +- include/mapnik/geometry_type.hpp | 38 +++---- include/mapnik/geometry_types.hpp | 2 +- include/mapnik/hit_test_filter.hpp | 18 ++-- .../json/extract_bounding_box_grammar.hpp | 2 +- .../mapnik/json/feature_generator_grammar.hpp | 6 +- .../json/geometry_generator_grammar.hpp | 38 +++---- .../json/geometry_generator_grammar_impl.hpp | 14 +-- include/mapnik/json/geometry_grammar.hpp | 8 +- include/mapnik/json/geometry_parser.hpp | 2 +- include/mapnik/json/geometry_util.hpp | 20 ++-- include/mapnik/json/positions_grammar.hpp | 2 +- include/mapnik/marker_helpers.hpp | 38 +++---- .../mapnik/markers_placements/interior.hpp | 4 +- include/mapnik/markers_placements/line.hpp | 2 +- include/mapnik/markers_placements/point.hpp | 2 +- .../markers_placements/vertext_first.hpp | 2 +- include/mapnik/memory_featureset.hpp | 4 +- .../renderer_common/pattern_alignment.hpp | 4 +- .../process_building_symbolizer.hpp | 12 +-- .../process_group_symbolizer.hpp | 2 +- .../process_markers_symbolizer.hpp | 18 ++-- .../process_point_symbolizer.hpp | 6 +- .../process_polygon_symbolizer.hpp | 2 +- .../svg/geometry_svg_generator_impl.hpp | 6 +- include/mapnik/text/symbolizer_helpers.hpp | 4 +- include/mapnik/util/geometry_to_ds_type.hpp | 18 ++-- include/mapnik/util/geometry_to_geojson.hpp | 4 +- include/mapnik/util/geometry_to_wkb.hpp | 34 +++--- .../util/spirit_transform_attribute.hpp | 78 +++++++------- include/mapnik/vertex_processor.hpp | 2 +- include/mapnik/wkb.hpp | 2 +- include/mapnik/wkt/wkt_factory.hpp | 6 +- include/mapnik/wkt/wkt_generator_grammar.hpp | 40 +++---- .../mapnik/wkt/wkt_generator_grammar_impl.hpp | 28 ++--- include/mapnik/wkt/wkt_grammar.hpp | 42 ++++---- include/mapnik/wkt/wkt_grammar_impl.hpp | 2 +- plugins/input/csv/csv_datasource.cpp | 8 +- plugins/input/gdal/gdal_featureset.cpp | 2 +- plugins/input/occi/occi_featureset.cpp | 24 ++--- plugins/input/ogr/ogr_converter.cpp | 36 +++---- plugins/input/ogr/ogr_converter.hpp | 16 +-- plugins/input/osm/osm_featureset.cpp | 8 +- plugins/input/postgis/postgis_featureset.cpp | 2 +- plugins/input/shape/shape_featureset.cpp | 6 +- .../input/shape/shape_index_featureset.cpp | 6 +- plugins/input/shape/shape_io.cpp | 24 ++--- plugins/input/shape/shape_io.hpp | 4 +- plugins/input/sqlite/sqlite_datasource.cpp | 4 +- plugins/input/sqlite/sqlite_featureset.cpp | 6 +- plugins/input/sqlite/sqlite_utils.hpp | 18 ++-- .../templates/helloworld/hello_featureset.cpp | 4 +- .../input/topojson/topojson_featureset.cpp | 20 ++-- src/agg/process_debug_symbolizer.cpp | 2 +- src/agg/process_dot_symbolizer.cpp | 2 +- src/agg/process_line_pattern_symbolizer.cpp | 4 +- src/agg/process_line_symbolizer.cpp | 4 +- .../process_polygon_pattern_symbolizer.cpp | 8 +- src/cairo/process_debug_symbolizer.cpp | 2 +- src/cairo/process_line_pattern_symbolizer.cpp | 2 +- src/cairo/process_line_symbolizer.cpp | 2 +- .../process_polygon_pattern_symbolizer.cpp | 4 +- src/grid/process_line_pattern_symbolizer.cpp | 2 +- src/grid/process_line_symbolizer.cpp | 2 +- .../process_polygon_pattern_symbolizer.cpp | 2 +- src/group/group_symbolizer_helper.cpp | 2 +- src/json/mapnik_json_generator_grammar.cpp | 2 +- src/text/symbolizer_helpers.cpp | 44 ++++---- src/wkb.cpp | 80 +++++++------- src/wkt/mapnik_wkt_generator_grammar.cpp | 2 +- tests/cpp_tests/fontset_runtime_test.cpp | 4 +- tests/cpp_tests/geometry_converters_test.cpp | 4 +- tests/cpp_tests/label_algo_test.cpp | 14 +-- tests/cpp_tests/wkb_formats_test.cpp | 10 +- tests/cxx/datasources.cpp | 9 +- tests/cxx/geometry.cpp | 12 +-- tests/cxx/geometry_hit_test.cpp | 2 +- utils/geometry_to_wkb/main.cpp | 2 +- utils/pgsql2sqlite/pgsql2sqlite.hpp | 6 +- 91 files changed, 603 insertions(+), 604 deletions(-) diff --git a/benchmark/test_polygon_clipping.cpp b/benchmark/test_polygon_clipping.cpp index ac42ed28f..89fc214e5 100644 --- a/benchmark/test_polygon_clipping.cpp +++ b/benchmark/test_polygon_clipping.cpp @@ -93,7 +93,7 @@ public: unsigned cmd; double x,y; clipped.rewind(0); - mapnik::geometry_type geom2(mapnik::new_geometry::geometry_types::Polygon); + mapnik::geometry_type geom2(mapnik::geometry::geometry_types::Polygon); while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { geom2.push_vertex(x,y,(mapnik::CommandType)cmd); } @@ -191,7 +191,7 @@ public: clipped.rewind(0); unsigned cmd; double x,y; - mapnik::geometry_type geom2(mapnik::new_geometry::geometry_types::Polygon); + mapnik::geometry_type geom2(mapnik::geometry::geometry_types::Polygon); while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { geom2.push_vertex(x,y,(mapnik::CommandType)cmd); } @@ -280,7 +280,7 @@ public: poly_clipper clipped(extent_, va); unsigned cmd; double x,y; - mapnik::geometry_type geom2(mapnik::new_geometry::geometry_types::Polygon); + mapnik::geometry_type geom2(mapnik::geometry::geometry_types::Polygon); while ((cmd = clipped.vertex(&x, &y)) != mapnik::SEG_END) { geom2.push_vertex(x,y,(mapnik::CommandType)cmd); } diff --git a/bindings/python/mapnik_geometry.cpp b/bindings/python/mapnik_geometry.cpp index b3f7e1e99..7193bcb1a 100644 --- a/bindings/python/mapnik_geometry.cpp +++ b/bindings/python/mapnik_geometry.cpp @@ -60,9 +60,9 @@ namespace { -std::shared_ptr from_wkb_impl(std::string const& wkb) +std::shared_ptr from_wkb_impl(std::string const& wkb) { - std::shared_ptr geom = std::make_shared(); + std::shared_ptr geom = std::make_shared(); try { *geom = std::move(mapnik::geometry_utils::from_wkb(wkb.c_str(), wkb.size())); @@ -74,17 +74,17 @@ std::shared_ptr from_wkb_impl(std::string const& return geom; } -std::shared_ptr from_wkt_impl(std::string const& wkt) +std::shared_ptr from_wkt_impl(std::string const& wkt) { - std::shared_ptr geom = std::make_shared(); + std::shared_ptr geom = std::make_shared(); if (!mapnik::from_wkt(wkt, *geom)) throw std::runtime_error("Failed to parse WKT geometry"); return geom; } -std::shared_ptr from_geojson_impl(std::string const& json) +std::shared_ptr from_geojson_impl(std::string const& json) { - std::shared_ptr geom = std::make_shared(); + std::shared_ptr geom = std::make_shared(); if (!mapnik::json::from_geojson(json, *geom)) throw std::runtime_error("Failed to parse geojson geometry"); return geom; @@ -99,7 +99,7 @@ inline std::string boost_version() return s.str(); } -PyObject* to_wkb_impl(mapnik::new_geometry::geometry const& geom, mapnik::wkbByteOrder byte_order) +PyObject* to_wkb_impl(mapnik::geometry::geometry const& geom, mapnik::wkbByteOrder byte_order) { mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,byte_order); if (wkb) @@ -118,7 +118,7 @@ PyObject* to_wkb_impl(mapnik::new_geometry::geometry const& geom, mapnik::wkbByt } } -std::string to_geojson_impl(mapnik::new_geometry::geometry const& geom) +std::string to_geojson_impl(mapnik::geometry::geometry const& geom) { std::string wkt; if (!mapnik::util::to_geojson(wkt, geom)) @@ -128,7 +128,7 @@ std::string to_geojson_impl(mapnik::new_geometry::geometry const& geom) return wkt; } -std::string to_wkt_impl(mapnik::new_geometry::geometry const& geom) +std::string to_wkt_impl(mapnik::geometry::geometry const& geom) { std::string wkt; if (!mapnik::to_wkt(wkt,geom)) @@ -138,45 +138,45 @@ std::string to_wkt_impl(mapnik::new_geometry::geometry const& geom) return wkt; } -mapnik::new_geometry::geometry_types geometry_type_impl(mapnik::new_geometry::geometry const& geom) +mapnik::geometry::geometry_types geometry_type_impl(mapnik::geometry::geometry const& geom) { - return mapnik::new_geometry::geometry_type(geom); + return mapnik::geometry::geometry_type(geom); } -mapnik::box2d geometry_envelope_impl(mapnik::new_geometry::geometry const& geom) +mapnik::box2d geometry_envelope_impl(mapnik::geometry::geometry const& geom) { - return mapnik::new_geometry::envelope(geom); + return mapnik::geometry::envelope(geom); } -bool geometry_is_valid_impl(mapnik::new_geometry::geometry const& geom) +bool geometry_is_valid_impl(mapnik::geometry::geometry const& geom) { - return mapnik::new_geometry::is_valid(geom); + return mapnik::geometry::is_valid(geom); } -bool geometry_is_simple_impl(mapnik::new_geometry::geometry const& geom) +bool geometry_is_simple_impl(mapnik::geometry::geometry const& geom) { - return mapnik::new_geometry::is_simple(geom); + return mapnik::geometry::is_simple(geom); } -void geometry_correct_impl(mapnik::new_geometry::geometry & geom) +void geometry_correct_impl(mapnik::geometry::geometry & geom) { - mapnik::new_geometry::correct(geom); + mapnik::geometry::correct(geom); } -void polygon_set_exterior_impl(mapnik::new_geometry::polygon & poly, mapnik::new_geometry::linear_ring const& ring) +void polygon_set_exterior_impl(mapnik::geometry::polygon & poly, mapnik::geometry::linear_ring const& ring) { poly.exterior_ring = ring; // copy } -void polygon_add_hole_impl(mapnik::new_geometry::polygon & poly, mapnik::new_geometry::linear_ring const& ring) +void polygon_add_hole_impl(mapnik::geometry::polygon & poly, mapnik::geometry::linear_ring const& ring) { poly.interior_rings.push_back(ring); // copy } -mapnik::new_geometry::point geometry_centroid_impl(mapnik::new_geometry::geometry const& geom) +mapnik::geometry::point geometry_centroid_impl(mapnik::geometry::geometry const& geom) { - mapnik::new_geometry::point pt; - mapnik::new_geometry::centroid(geom, pt); + mapnik::geometry::point pt; + mapnik::geometry::centroid(geom, pt); return pt; } @@ -185,18 +185,18 @@ void export_geometry() { using namespace boost::python; - implicitly_convertible(); - implicitly_convertible(); - implicitly_convertible(); - enum_("GeometryType") - .value("Unknown",mapnik::new_geometry::geometry_types::Unknown) - .value("Point",mapnik::new_geometry::geometry_types::Point) - .value("LineString",mapnik::new_geometry::geometry_types::LineString) - .value("Polygon",mapnik::new_geometry::geometry_types::Polygon) - .value("MultiPoint",mapnik::new_geometry::geometry_types::MultiPoint) - .value("MultiLineString",mapnik::new_geometry::geometry_types::MultiLineString) - .value("MultiPolygon",mapnik::new_geometry::geometry_types::MultiPolygon) - .value("GeometryCollection",mapnik::new_geometry::geometry_types::GeometryCollection) + implicitly_convertible(); + implicitly_convertible(); + implicitly_convertible(); + enum_("GeometryType") + .value("Unknown",mapnik::geometry::geometry_types::Unknown) + .value("Point",mapnik::geometry::geometry_types::Point) + .value("LineString",mapnik::geometry::geometry_types::LineString) + .value("Polygon",mapnik::geometry::geometry_types::Polygon) + .value("MultiPoint",mapnik::geometry::geometry_types::MultiPoint) + .value("MultiLineString",mapnik::geometry::geometry_types::MultiLineString) + .value("MultiPolygon",mapnik::geometry::geometry_types::MultiPolygon) + .value("GeometryCollection",mapnik::geometry::geometry_types::GeometryCollection) ; enum_("wkbByteOrder") @@ -204,11 +204,11 @@ void export_geometry() .value("NDR",mapnik::wkbNDR) ; - using mapnik::new_geometry::geometry; - using mapnik::new_geometry::point; - using mapnik::new_geometry::line_string; - using mapnik::new_geometry::linear_ring; - using mapnik::new_geometry::polygon; + using mapnik::geometry::geometry; + using mapnik::geometry::point; + using mapnik::geometry::line_string; + using mapnik::geometry::linear_ring; + using mapnik::geometry::polygon; class_("Point", init((arg("x"), arg("y")), "Constructs a new Point object\n")) diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 8c54ad179..6d975bf49 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -105,7 +105,7 @@ public: : id_(id), ctx_(ctx), data_(ctx_->mapping_.size()), - geom_(new_geometry::geometry_empty()), + geom_(geometry::geometry_empty()), raster_() {} inline mapnik::value_integer id() const { return id_;} @@ -195,24 +195,24 @@ public: return ctx_; } - inline void set_geometry(new_geometry::geometry && geom) + inline void set_geometry(geometry::geometry && geom) { geom_ = std::move(geom); } - inline void set_geometry_copy(new_geometry::geometry const& geom) + inline void set_geometry_copy(geometry::geometry const& geom) { geom_ = geom; } - inline new_geometry::geometry const& get_geometry() const + inline geometry::geometry const& get_geometry() const { return geom_; } inline box2d envelope() const { - return mapnik::new_geometry::envelope(geom_); + return mapnik::geometry::envelope(geom_); } inline raster_ptr const& get_raster() const @@ -262,7 +262,7 @@ private: mapnik::value_integer id_; context_ptr ctx_; cont_type data_; - new_geometry::geometry geom_; + geometry::geometry geom_; raster_ptr raster_; }; diff --git a/include/mapnik/geom_util.hpp b/include/mapnik/geom_util.hpp index f158b1e15..7bfbd5cb1 100644 --- a/include/mapnik/geom_util.hpp +++ b/include/mapnik/geom_util.hpp @@ -462,7 +462,7 @@ bool hit_test(PathType & path, double x, double y, double tol) return false; } unsigned count = 0; - mapnik::new_geometry::geometry_types geom_type = static_cast(path.type()); + mapnik::geometry::geometry_types geom_type = static_cast(path.type()); while (SEG_END != (command = path.vertex(&x1, &y1))) { if (command == SEG_CLOSE) @@ -478,7 +478,7 @@ bool hit_test(PathType & path, double x, double y, double tol) } switch(geom_type) { - case mapnik::new_geometry::geometry_types::Polygon: + case mapnik::geometry::geometry_types::Polygon: { if ((((y1 <= y) && (y < y0)) || ((y0 <= y) && (y < y1))) && @@ -486,7 +486,7 @@ bool hit_test(PathType & path, double x, double y, double tol) inside=!inside; break; } - case mapnik::new_geometry::geometry_types::LineString: + case mapnik::geometry::geometry_types::LineString: { double distance = point_to_segment_distance(x,y,x0,y0,x1,y1); if (distance < tol) diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 5d9065b89..9f95b0cfd 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -36,7 +36,7 @@ #include #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { struct point { diff --git a/include/mapnik/geometry_adapters.hpp b/include/mapnik/geometry_adapters.hpp index fc838509b..0ebb5d1bb 100644 --- a/include/mapnik/geometry_adapters.hpp +++ b/include/mapnik/geometry_adapters.hpp @@ -34,155 +34,155 @@ #include // register point -BOOST_GEOMETRY_REGISTER_POINT_2D (mapnik::new_geometry::point, double, cs::cartesian, x, y) +BOOST_GEOMETRY_REGISTER_POINT_2D (mapnik::geometry::point, double, cs::cartesian, x, y) // ring -BOOST_GEOMETRY_REGISTER_RING(mapnik::new_geometry::linear_ring) +BOOST_GEOMETRY_REGISTER_RING(mapnik::geometry::linear_ring) namespace boost { template <> -struct range_iterator +struct range_iterator { - using type = mapnik::new_geometry::line_string::iterator; + using type = mapnik::geometry::line_string::iterator; }; template <> -struct range_const_iterator +struct range_const_iterator { - using type = mapnik::new_geometry::line_string::const_iterator; + using type = mapnik::geometry::line_string::const_iterator; }; -inline mapnik::new_geometry::line_string::iterator -range_begin(mapnik::new_geometry::line_string & line) {return line.begin();} +inline mapnik::geometry::line_string::iterator +range_begin(mapnik::geometry::line_string & line) {return line.begin();} -inline mapnik::new_geometry::line_string::iterator -range_end(mapnik::new_geometry::line_string & line) {return line.end();} +inline mapnik::geometry::line_string::iterator +range_end(mapnik::geometry::line_string & line) {return line.end();} -inline mapnik::new_geometry::line_string::const_iterator -range_begin(mapnik::new_geometry::line_string const& line) {return line.begin();} +inline mapnik::geometry::line_string::const_iterator +range_begin(mapnik::geometry::line_string const& line) {return line.begin();} -inline mapnik::new_geometry::line_string::const_iterator -range_end(mapnik::new_geometry::line_string const& line) {return line.end();} +inline mapnik::geometry::line_string::const_iterator +range_end(mapnik::geometry::line_string const& line) {return line.end();} namespace geometry { namespace traits { -template<> struct tag { using type = box_tag; }; +template<> struct tag { using type = box_tag; }; -template<> struct point_type { using type = mapnik::new_geometry::point; }; +template<> struct point_type { using type = mapnik::geometry::point; }; template <> -struct indexed_access +struct indexed_access { - static inline double get(mapnik::new_geometry::bounding_box const& b) { return b.p0.x;} - static inline void set(mapnik::new_geometry::bounding_box& b, double value) { b.p0.x = value; } + static inline double get(mapnik::geometry::bounding_box const& b) { return b.p0.x;} + static inline void set(mapnik::geometry::bounding_box& b, double value) { b.p0.x = value; } }; template <> -struct indexed_access +struct indexed_access { - static inline double get(mapnik::new_geometry::bounding_box const& b) { return b.p0.y;} - static inline void set(mapnik::new_geometry::bounding_box& b, double value) { b.p0.y = value; } + static inline double get(mapnik::geometry::bounding_box const& b) { return b.p0.y;} + static inline void set(mapnik::geometry::bounding_box& b, double value) { b.p0.y = value; } }; template <> -struct indexed_access +struct indexed_access { - static inline double get(mapnik::new_geometry::bounding_box const& b) { return b.p1.x;} - static inline void set(mapnik::new_geometry::bounding_box& b, double value) { b.p1.x = value; } + static inline double get(mapnik::geometry::bounding_box const& b) { return b.p1.x;} + static inline void set(mapnik::geometry::bounding_box& b, double value) { b.p1.x = value; } }; template <> -struct indexed_access +struct indexed_access { - static inline double get(mapnik::new_geometry::bounding_box const& b) { return b.p1.y;} - static inline void set(mapnik::new_geometry::bounding_box& b, double value) { b.p1.y = value; } + static inline double get(mapnik::geometry::bounding_box const& b) { return b.p1.y;} + static inline void set(mapnik::geometry::bounding_box& b, double value) { b.p1.y = value; } }; template<> -struct tag +struct tag { using type = linestring_tag; }; -// mapnik::new_geometry::polygon +// mapnik::geometry::polygon template<> -struct tag +struct tag { using type = polygon_tag; }; template <> -struct point_order +struct point_order { static const order_selector value = counterclockwise; }; template<> -struct tag +struct tag { using type = multi_point_tag; }; template<> -struct tag +struct tag { using type = multi_linestring_tag; }; -template<> struct tag +template<> struct tag { using type = multi_polygon_tag; }; // ring -template<> struct ring_const_type +template<> struct ring_const_type { - using type = mapnik::new_geometry::linear_ring const&; + using type = mapnik::geometry::linear_ring const&; }; -template<> struct ring_mutable_type +template<> struct ring_mutable_type { - using type = mapnik::new_geometry::linear_ring&; + using type = mapnik::geometry::linear_ring&; }; // interior -template<> struct interior_const_type +template<> struct interior_const_type { - using type = std::vector const&; + using type = std::vector const&; }; -template<> struct interior_mutable_type +template<> struct interior_mutable_type { - using type = std::vector&; + using type = std::vector&; }; // exterior template<> -struct exterior_ring +struct exterior_ring { - static mapnik::new_geometry::linear_ring& get(mapnik::new_geometry::polygon & p) + static mapnik::geometry::linear_ring& get(mapnik::geometry::polygon & p) { return p.exterior_ring; } - static mapnik::new_geometry::linear_ring const& get(mapnik::new_geometry::polygon const& p) + static mapnik::geometry::linear_ring const& get(mapnik::geometry::polygon const& p) { return p.exterior_ring; } }; template<> -struct interior_rings +struct interior_rings { - using holes_type = std::vector; - static holes_type& get(mapnik::new_geometry::polygon & p) + using holes_type = std::vector; + static holes_type& get(mapnik::geometry::polygon & p) { return p.interior_rings; } - static holes_type const& get(mapnik::new_geometry::polygon const& p) + static holes_type const& get(mapnik::geometry::polygon const& p) { return p.interior_rings; } diff --git a/include/mapnik/geometry_centroid.hpp b/include/mapnik/geometry_centroid.hpp index 9b53f6ea5..8767395f4 100644 --- a/include/mapnik/geometry_centroid.hpp +++ b/include/mapnik/geometry_centroid.hpp @@ -27,7 +27,7 @@ #include #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { namespace detail { @@ -62,7 +62,7 @@ struct geometry_centroid } -inline bool centroid(mapnik::new_geometry::geometry const& geom, point & pt) +inline bool centroid(mapnik::geometry::geometry const& geom, point & pt) { return detail::geometry_centroid(pt) (geom); } diff --git a/include/mapnik/geometry_correct.hpp b/include/mapnik/geometry_correct.hpp index 2d751c6a7..59da9d172 100644 --- a/include/mapnik/geometry_correct.hpp +++ b/include/mapnik/geometry_correct.hpp @@ -27,7 +27,7 @@ #include #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { namespace detail { @@ -62,7 +62,7 @@ struct geometry_correct } -inline void correct(mapnik::new_geometry::geometry & geom) +inline void correct(mapnik::geometry::geometry & geom) { return mapnik::util::apply_visitor(detail::geometry_correct(), geom); } diff --git a/include/mapnik/geometry_empty.hpp b/include/mapnik/geometry_empty.hpp index 66d9f1bff..c9c9ca584 100644 --- a/include/mapnik/geometry_empty.hpp +++ b/include/mapnik/geometry_empty.hpp @@ -25,48 +25,48 @@ #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { namespace detail { struct geometry_empty { - bool operator() (mapnik::new_geometry::geometry const& geom) const + bool operator() (mapnik::geometry::geometry const& geom) const { return mapnik::util::apply_visitor(*this, geom); } - bool operator() (mapnik::new_geometry::point const&) const + bool operator() (mapnik::geometry::point const&) const { return false; } - bool operator() (mapnik::new_geometry::line_string const& geom) const + bool operator() (mapnik::geometry::line_string const& geom) const { return geom.empty(); } - bool operator() (mapnik::new_geometry::polygon const& geom) const + bool operator() (mapnik::geometry::polygon const& geom) const { return geom.empty(); } - bool operator() (mapnik::new_geometry::multi_point const& geom) const + bool operator() (mapnik::geometry::multi_point const& geom) const { return geom.empty(); } - bool operator() (mapnik::new_geometry::multi_line_string const& geom) const + bool operator() (mapnik::geometry::multi_line_string const& geom) const { return geom.empty(); } - bool operator() (mapnik::new_geometry::multi_polygon const& geom) const + bool operator() (mapnik::geometry::multi_polygon const& geom) const { return geom.empty(); } - bool operator() (mapnik::new_geometry::geometry_collection const& geom) const + bool operator() (mapnik::geometry::geometry_collection const& geom) const { return geom.empty(); } @@ -74,7 +74,7 @@ struct geometry_empty } -inline bool empty(mapnik::new_geometry::geometry const& geom) +inline bool empty(mapnik::geometry::geometry const& geom) { return detail::geometry_empty()(geom); } diff --git a/include/mapnik/geometry_envelope.hpp b/include/mapnik/geometry_envelope.hpp index 9611a83ef..48ac55a1f 100644 --- a/include/mapnik/geometry_envelope.hpp +++ b/include/mapnik/geometry_envelope.hpp @@ -26,7 +26,7 @@ #include #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { namespace detail { @@ -34,22 +34,22 @@ struct geometry_envelope { using bbox_type = box2d; - bbox_type operator() (mapnik::new_geometry::geometry const& geom) const + bbox_type operator() (mapnik::geometry::geometry const& geom) const { return mapnik::util::apply_visitor(*this, geom); } - bbox_type operator() (mapnik::new_geometry::geometry_empty const&) const + bbox_type operator() (mapnik::geometry::geometry_empty const&) const { return mapnik::box2d(); } - bbox_type operator() (mapnik::new_geometry::point const& pt) const + bbox_type operator() (mapnik::geometry::point const& pt) const { return mapnik::box2d(pt.x, pt.y, pt.x, pt.y); } - bbox_type operator() (mapnik::new_geometry::line_string const& line) const + bbox_type operator() (mapnik::geometry::line_string const& line) const { bbox_type bbox; for (auto const& pt : line) @@ -60,17 +60,17 @@ struct geometry_envelope return bbox; } - bbox_type operator() (mapnik::new_geometry::polygon const& poly) const + bbox_type operator() (mapnik::geometry::polygon const& poly) const { - return (*this) (static_cast(poly.exterior_ring)); + return (*this) (static_cast(poly.exterior_ring)); } - bbox_type operator() (mapnik::new_geometry::multi_point const& multi_point) const + bbox_type operator() (mapnik::geometry::multi_point const& multi_point) const { - return (*this) (static_cast(multi_point)); + return (*this) (static_cast(multi_point)); } - bbox_type operator() (mapnik::new_geometry::multi_line_string const& multi_line) const + bbox_type operator() (mapnik::geometry::multi_line_string const& multi_line) const { bbox_type bbox; for (auto const& line : multi_line) @@ -81,7 +81,7 @@ struct geometry_envelope return bbox; } - bbox_type operator() (mapnik::new_geometry::multi_polygon const& multi_poly) const + bbox_type operator() (mapnik::geometry::multi_polygon const& multi_poly) const { bbox_type bbox; for (auto const& poly : multi_poly) @@ -92,7 +92,7 @@ struct geometry_envelope return bbox; } - bbox_type operator() (mapnik::new_geometry::geometry_collection const& collection) const + bbox_type operator() (mapnik::geometry::geometry_collection const& collection) const { bbox_type bbox; for (auto const& geom : collection) @@ -106,7 +106,7 @@ struct geometry_envelope } -inline mapnik::box2d envelope(mapnik::new_geometry::geometry const& geom) +inline mapnik::box2d envelope(mapnik::geometry::geometry const& geom) { return detail::geometry_envelope() (geom); } diff --git a/include/mapnik/geometry_fusion_adapted.hpp b/include/mapnik/geometry_fusion_adapted.hpp index ce5b643bc..a57455a76 100644 --- a/include/mapnik/geometry_fusion_adapted.hpp +++ b/include/mapnik/geometry_fusion_adapted.hpp @@ -27,14 +27,14 @@ #include BOOST_FUSION_ADAPT_STRUCT( - mapnik::new_geometry::point, + mapnik::geometry::point, (double, x) (double, y) ) BOOST_FUSION_ADAPT_STRUCT( - mapnik::new_geometry::polygon, - (mapnik::new_geometry::linear_ring const&, exterior_ring) - (std::vector const& , interior_rings)) + mapnik::geometry::polygon, + (mapnik::geometry::linear_ring const&, exterior_ring) + (std::vector const& , interior_rings)) #endif // MAPNIK_GEOMETRY_FUSION_ADAPTED_HPP diff --git a/include/mapnik/geometry_is_simple.hpp b/include/mapnik/geometry_is_simple.hpp index 23feb25ef..b815ad0d2 100644 --- a/include/mapnik/geometry_is_simple.hpp +++ b/include/mapnik/geometry_is_simple.hpp @@ -27,7 +27,7 @@ #include #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { namespace detail { @@ -63,7 +63,7 @@ struct geometry_is_simple } -inline bool is_simple(mapnik::new_geometry::geometry const& geom) +inline bool is_simple(mapnik::geometry::geometry const& geom) { return detail::geometry_is_simple() (geom); } diff --git a/include/mapnik/geometry_is_valid.hpp b/include/mapnik/geometry_is_valid.hpp index 5b0ac00ee..2d64cf7d1 100644 --- a/include/mapnik/geometry_is_valid.hpp +++ b/include/mapnik/geometry_is_valid.hpp @@ -27,7 +27,7 @@ #include #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { namespace detail { @@ -63,7 +63,7 @@ struct geometry_is_valid } -inline bool is_valid(mapnik::new_geometry::geometry const& geom) +inline bool is_valid(mapnik::geometry::geometry const& geom) { return detail::geometry_is_valid() (geom); } diff --git a/include/mapnik/geometry_type.hpp b/include/mapnik/geometry_type.hpp index 987a9bb13..60275016c 100644 --- a/include/mapnik/geometry_type.hpp +++ b/include/mapnik/geometry_type.hpp @@ -27,58 +27,58 @@ #include #include -namespace mapnik { namespace new_geometry { namespace detail { +namespace mapnik { namespace geometry { namespace detail { struct geometry_type { - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::geometry const& geom) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::geometry const& geom) const { return mapnik::util::apply_visitor(*this, geom); } - mapnik::new_geometry::geometry_types operator() (geometry_empty const& ) const + mapnik::geometry::geometry_types operator() (geometry_empty const& ) const { - return mapnik::new_geometry::geometry_types::Unknown; + return mapnik::geometry::geometry_types::Unknown; } - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::point const&) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::point const&) const { - return mapnik::new_geometry::geometry_types::Point; + return mapnik::geometry::geometry_types::Point; } - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::line_string const&) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::line_string const&) const { - return mapnik::new_geometry::geometry_types::LineString; + return mapnik::geometry::geometry_types::LineString; } - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::polygon const&) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::polygon const&) const { - return mapnik::new_geometry::geometry_types::Polygon; + return mapnik::geometry::geometry_types::Polygon; } - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::multi_point const&) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::multi_point const&) const { - return mapnik::new_geometry::geometry_types::MultiPoint; + return mapnik::geometry::geometry_types::MultiPoint; } - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::multi_line_string const&) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::multi_line_string const&) const { - return mapnik::new_geometry::geometry_types::MultiLineString; + return mapnik::geometry::geometry_types::MultiLineString; } - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::multi_polygon const&) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::multi_polygon const&) const { - return mapnik::new_geometry::geometry_types::MultiPolygon; + return mapnik::geometry::geometry_types::MultiPolygon; } - mapnik::new_geometry::geometry_types operator () (mapnik::new_geometry::geometry_collection const&) const + mapnik::geometry::geometry_types operator () (mapnik::geometry::geometry_collection const&) const { - return mapnik::new_geometry::geometry_types::GeometryCollection; + return mapnik::geometry::geometry_types::GeometryCollection; } }; } // detail -static inline mapnik::new_geometry::geometry_types geometry_type(mapnik::new_geometry::geometry const& geom) +static inline mapnik::geometry::geometry_types geometry_type(mapnik::geometry::geometry const& geom) { return detail::geometry_type()(geom); } diff --git a/include/mapnik/geometry_types.hpp b/include/mapnik/geometry_types.hpp index ebff492cb..76a9e6515 100644 --- a/include/mapnik/geometry_types.hpp +++ b/include/mapnik/geometry_types.hpp @@ -23,7 +23,7 @@ #ifndef MAPNIK_GEOMETRY_TYPES_HPP #define MAPNIK_GEOMETRY_TYPES_HPP -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { // OGC compatible types enum geometry_types : std::uint8_t diff --git a/include/mapnik/hit_test_filter.hpp b/include/mapnik/hit_test_filter.hpp index efad5ff4e..7d6a7bd69 100644 --- a/include/mapnik/hit_test_filter.hpp +++ b/include/mapnik/hit_test_filter.hpp @@ -49,16 +49,16 @@ struct hit_test_visitor y_(y), tol_(tol) {} - bool operator() (new_geometry::geometry_empty const& ) const + bool operator() (geometry::geometry_empty const& ) const { return false; } - bool operator() (new_geometry::point const& geom) const + bool operator() (geometry::point const& geom) const { return distance(geom.x, geom.y, x_, y_) <= tol_; } - bool operator() (new_geometry::multi_point const& geom) const + bool operator() (geometry::multi_point const& geom) const { for (auto const& pt : geom) { @@ -66,7 +66,7 @@ struct hit_test_visitor } return false; } - bool operator() (new_geometry::line_string const& geom) const + bool operator() (geometry::line_string const& geom) const { std::size_t num_points = geom.num_points(); if (num_points > 1) @@ -81,7 +81,7 @@ struct hit_test_visitor } return false; } - bool operator() (new_geometry::multi_line_string const& geom) const + bool operator() (geometry::multi_line_string const& geom) const { for (auto const& line: geom) { @@ -89,7 +89,7 @@ struct hit_test_visitor } return false; } - bool operator() (new_geometry::polygon const& geom) const + bool operator() (geometry::polygon const& geom) const { auto const& exterior = geom.exterior_ring; std::size_t num_points = exterior.num_points(); @@ -124,7 +124,7 @@ struct hit_test_visitor } return inside; } - bool operator() (new_geometry::multi_polygon const& geom) const + bool operator() (geometry::multi_polygon const& geom) const { for (auto const& poly: geom) { @@ -132,7 +132,7 @@ struct hit_test_visitor } return false; } - bool operator() (new_geometry::geometry_collection const& collection) const + bool operator() (geometry::geometry_collection const& collection) const { for (auto const& geom: collection) { @@ -148,7 +148,7 @@ struct hit_test_visitor } -inline bool hit_test(mapnik::new_geometry::geometry const& geom, double x, double y, double tol) +inline bool hit_test(mapnik::geometry::geometry const& geom, double x, double y, double tol) { return mapnik::util::apply_visitor(detail::hit_test_visitor(x,y,tol), geom); } diff --git a/include/mapnik/json/extract_bounding_box_grammar.hpp b/include/mapnik/json/extract_bounding_box_grammar.hpp index a7b5d1a71..7f291e21a 100644 --- a/include/mapnik/json/extract_bounding_box_grammar.hpp +++ b/include/mapnik/json/extract_bounding_box_grammar.hpp @@ -42,7 +42,7 @@ namespace mapnik { namespace json { -using position = mapnik::new_geometry::point; +using position = mapnik::geometry::point; using boxes = std::vector, std::pair>>; namespace qi = boost::spirit::qi; diff --git a/include/mapnik/json/feature_generator_grammar.hpp b/include/mapnik/json/feature_generator_grammar.hpp index 82e455c71..79714aaae 100644 --- a/include/mapnik/json/feature_generator_grammar.hpp +++ b/include/mapnik/json/feature_generator_grammar.hpp @@ -65,9 +65,9 @@ struct end_container template <> struct transform_attribute, - mapnik::new_geometry::geometry const& , karma::domain> + mapnik::geometry::geometry const& , karma::domain> { - using type = mapnik::new_geometry::geometry const&; + using type = mapnik::geometry::geometry const&; static type pre(const boost::fusion::cons& f) { return boost::fusion::at >(f).get_geometry(); @@ -98,7 +98,7 @@ struct feature_generator_grammar : { feature_generator_grammar(); karma::rule feature; - geometry_generator_grammar geometry; + geometry_generator_grammar geometry; properties_generator_grammar properties; boost::phoenix::function > id_; }; diff --git a/include/mapnik/json/geometry_generator_grammar.hpp b/include/mapnik/json/geometry_generator_grammar.hpp index d068ea99f..15745b694 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -47,11 +47,11 @@ namespace detail { template struct get_type { - using result_type = mapnik::new_geometry::geometry_types; + using result_type = mapnik::geometry::geometry_types; template result_type operator() (T const& geom) const { - auto type = mapnik::new_geometry::geometry_type(geom); + auto type = mapnik::geometry::geometry_type(geom); return type; } }; @@ -93,23 +93,23 @@ struct geometry_generator_grammar : { geometry_generator_grammar(); karma::rule geometry; - karma::rule, Geometry const&() > geometry_dispatch; - karma::rule point; - karma::rule point_coord; - karma::rule linestring; - karma::rule linestring_coord; - karma::rule polygon; - karma::rule polygon_coord; - karma::rule exterior_ring_coord; - karma::rule const&()> interior_ring_coord; - karma::rule multi_point; - karma::rule multi_point_coord; - karma::rule multi_linestring; - karma::rule multi_linestring_coord; - karma::rule multi_polygon; - karma::rule multi_polygon_coord; - karma::rule geometry_collection; - karma::rule geometries; + karma::rule, Geometry const&() > geometry_dispatch; + karma::rule point; + karma::rule point_coord; + karma::rule linestring; + karma::rule linestring_coord; + karma::rule polygon; + karma::rule polygon_coord; + karma::rule exterior_ring_coord; + karma::rule const&()> interior_ring_coord; + karma::rule multi_point; + karma::rule multi_point_coord; + karma::rule multi_linestring; + karma::rule multi_linestring_coord; + karma::rule multi_polygon; + karma::rule multi_polygon_coord; + karma::rule geometry_collection; + karma::rule geometries; boost::phoenix::function > geometry_type; karma::real_generator > coordinate; diff --git a/include/mapnik/json/geometry_generator_grammar_impl.hpp b/include/mapnik/json/geometry_generator_grammar_impl.hpp index 2a6739ca1..c6968cfc0 100644 --- a/include/mapnik/json/geometry_generator_grammar_impl.hpp +++ b/include/mapnik/json/geometry_generator_grammar_impl.hpp @@ -51,25 +51,25 @@ geometry_generator_grammar::geometry_generator_grammar ; geometry_dispatch = eps[_a = geometry_type(_val)] << - (&uint_(new_geometry::geometry_types::Point)[_1 = _a] + (&uint_(geometry::geometry_types::Point)[_1 = _a] << (point | lit("null"))) | - (&uint_(new_geometry::geometry_types::LineString)[_1 = _a] + (&uint_(geometry::geometry_types::LineString)[_1 = _a] << (linestring | lit("null"))) | - (&uint_(new_geometry::geometry_types::Polygon)[_1 = _a] + (&uint_(geometry::geometry_types::Polygon)[_1 = _a] << (polygon | lit("null"))) | - (&uint_(new_geometry::geometry_types::MultiPoint)[_1 = _a] + (&uint_(geometry::geometry_types::MultiPoint)[_1 = _a] << (multi_point | lit("null"))) | - (&uint_(new_geometry::geometry_types::MultiLineString)[_1 = _a] + (&uint_(geometry::geometry_types::MultiLineString)[_1 = _a] << (multi_linestring | lit("null"))) | - (&uint_(new_geometry::geometry_types::MultiPolygon)[_1 = _a] + (&uint_(geometry::geometry_types::MultiPolygon)[_1 = _a] << (multi_polygon | lit("null"))) | - (&uint_(new_geometry::geometry_types::GeometryCollection)[_1 = _a] + (&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a] << (geometry_collection | lit("null"))) | lit("null") diff --git a/include/mapnik/json/geometry_grammar.hpp b/include/mapnik/json/geometry_grammar.hpp index d85f30666..28a9615f5 100644 --- a/include/mapnik/json/geometry_grammar.hpp +++ b/include/mapnik/json/geometry_grammar.hpp @@ -40,13 +40,13 @@ namespace qi = boost::spirit::qi; template > struct geometry_grammar : - qi::grammar + qi::grammar { geometry_grammar(); - qi::rule start; - qi::rule, mapnik::new_geometry::geometry(), space_type> geometry; + qi::rule start; + qi::rule, mapnik::geometry::geometry(), space_type> geometry; qi::symbols geometry_type_dispatch; - qi::rule geometry_collection; + qi::rule geometry_collection; positions_grammar coordinates; boost::phoenix::function create_geometry; // error handler diff --git a/include/mapnik/json/geometry_parser.hpp b/include/mapnik/json/geometry_parser.hpp index 5f98eda79..bf927024f 100644 --- a/include/mapnik/json/geometry_parser.hpp +++ b/include/mapnik/json/geometry_parser.hpp @@ -34,7 +34,7 @@ namespace mapnik { namespace json { -inline bool from_geojson(std::string const& json, mapnik::new_geometry::geometry & geom) +inline bool from_geojson(std::string const& json, mapnik::geometry::geometry & geom) { using namespace boost::spirit; static const geometry_grammar g; diff --git a/include/mapnik/json/geometry_util.hpp b/include/mapnik/json/geometry_util.hpp index ddd2219c5..22692aea8 100644 --- a/include/mapnik/json/geometry_util.hpp +++ b/include/mapnik/json/geometry_util.hpp @@ -39,7 +39,7 @@ struct create_point void operator() (position const& pos) const { - mapnik::new_geometry::point point(pos.x, pos.y); + mapnik::geometry::point point(pos.x, pos.y); geom_ = std::move(point); } @@ -59,7 +59,7 @@ struct create_linestring std::size_t size = ring.size(); if (size > 1) { - mapnik::new_geometry::line_string line; + mapnik::geometry::line_string line; line.reserve(size); for (auto && pt : ring) { @@ -83,7 +83,7 @@ struct create_polygon void operator() (std::vector const& rings) const { - mapnik::new_geometry::polygon poly; + mapnik::geometry::polygon poly; std::size_t num_rings = rings.size(); if (num_rings > 1) poly.interior_rings.reserve(num_rings - 1); @@ -91,7 +91,7 @@ struct create_polygon for ( std::size_t i = 0; i < num_rings; ++i) { std::size_t size = rings[i].size(); - mapnik::new_geometry::linear_ring ring; + mapnik::geometry::linear_ring ring; ring.reserve(size); for ( auto && pt : rings[i]) { @@ -120,7 +120,7 @@ struct create_multipoint void operator() (positions const& points) const { - mapnik::new_geometry::multi_point multi_point; + mapnik::geometry::multi_point multi_point; multi_point.reserve(points.size()); for (auto && pos : points) { @@ -143,12 +143,12 @@ struct create_multilinestring void operator() (std::vector const& rings) const { - mapnik::new_geometry::multi_line_string multi_line; + mapnik::geometry::multi_line_string multi_line; multi_line.reserve(rings.size()); for (auto const& ring : rings) { - mapnik::new_geometry::line_string line; + mapnik::geometry::line_string line; line.reserve(ring.size()); for (auto && pt : ring) { @@ -173,11 +173,11 @@ struct create_multipolygon void operator()(std::vector > const& rings_array) const { - mapnik::new_geometry::multi_polygon multi_poly; + mapnik::geometry::multi_polygon multi_poly; multi_poly.reserve(rings_array.size()); for (auto const& rings : rings_array) { - mapnik::new_geometry::polygon poly; + mapnik::geometry::polygon poly; std::size_t num_rings = rings.size(); if ( num_rings > 1) poly.interior_rings.reserve(num_rings - 1); @@ -185,7 +185,7 @@ struct create_multipolygon for ( std::size_t i = 0; i < num_rings; ++i) { std::size_t size = rings[i].size(); - mapnik::new_geometry::linear_ring ring; + mapnik::geometry::linear_ring ring; ring.reserve(size); for ( auto && pt : rings[i]) { diff --git a/include/mapnik/json/positions_grammar.hpp b/include/mapnik/json/positions_grammar.hpp index 1e0ca8879..2cdf03321 100644 --- a/include/mapnik/json/positions_grammar.hpp +++ b/include/mapnik/json/positions_grammar.hpp @@ -45,7 +45,7 @@ namespace mapnik { namespace json { struct empty {}; -using position = mapnik::new_geometry::point; +using position = mapnik::geometry::point; using positions = std::vector; using coordinates = util::variant, std::vector > > ; diff --git a/include/mapnik/marker_helpers.hpp b/include/mapnik/marker_helpers.hpp index f12e6a7c7..fc5f2d4b2 100644 --- a/include/mapnik/marker_helpers.hpp +++ b/include/mapnik/marker_helpers.hpp @@ -197,19 +197,19 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co { using vertex_converter_type = Converter; using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; auto const& geom = feature.get_geometry(); - new_geometry::geometry_types type = new_geometry::geometry_type(geom); + geometry::geometry_types type = geometry::geometry_type(geom); - if (type == new_geometry::geometry_types::Point - || type == new_geometry::geometry_types::LineString - || type == new_geometry::geometry_types::Polygon) + if (type == geometry::geometry_types::Point + || type == geometry::geometry_types::LineString + || type == geometry::geometry_types::Polygon) { apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply), geom); } - else //if (type != new_geometry::geometry_types::GeometryCollection) // multi geometries/collection + else //if (type != geometry::geometry_types::GeometryCollection) // multi geometries/collection { marker_multi_policy_enum multi_policy = get(sym, feature, vars); @@ -218,12 +218,12 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co if (placement == MARKER_POINT_PLACEMENT && multi_policy == MARKER_WHOLE_MULTI) { - new_geometry::point pt; - if (new_geometry::centroid(geom, pt)) + geometry::point pt; + if (geometry::centroid(geom, pt)) { // unset any clipping since we're now dealing with a point converter.template unset(); - new_geometry::point_vertex_adapter va(pt); + geometry::point_vertex_adapter va(pt); converter.apply(va); } } @@ -232,15 +232,15 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co { // Only apply to path with largest envelope area // TODO: consider using true area for polygon types - if (type == new_geometry::geometry_types::MultiPolygon) + if (type == geometry::geometry_types::MultiPolygon) { - new_geometry::multi_polygon const& multi_poly = mapnik::util::get(geom); + geometry::multi_polygon const& multi_poly = mapnik::util::get(geom); double maxarea = 0; - new_geometry::polygon const* largest = 0; - for (new_geometry::polygon const& poly : multi_poly) + geometry::polygon const* largest = 0; + for (geometry::polygon const& poly : multi_poly) { - box2d bbox = new_geometry::envelope(poly); - new_geometry::polygon_vertex_adapter va(poly); + box2d bbox = geometry::envelope(poly); + geometry::polygon_vertex_adapter va(poly); double area = bbox.width() * bbox.height(); if (area > maxarea) { @@ -250,21 +250,21 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co } if (largest) { - new_geometry::polygon_vertex_adapter va(*largest); + geometry::polygon_vertex_adapter va(*largest); converter.apply(va); } } } - else if (type == new_geometry::geometry_types::MultiPolygon) + else if (type == geometry::geometry_types::MultiPolygon) { if (multi_policy != MARKER_EACH_MULTI && placement != MARKER_POINT_PLACEMENT) { MAPNIK_LOG_WARN(marker_symbolizer) << "marker_multi_policy != 'each' has no effect with marker_placement != 'point'"; } - new_geometry::multi_polygon const& multi_poly = mapnik::util::get(geom); + geometry::multi_polygon const& multi_poly = mapnik::util::get(geom); for (auto const& poly : multi_poly) { - new_geometry::polygon_vertex_adapter va(poly); + geometry::polygon_vertex_adapter va(poly); converter.apply(va); } } diff --git a/include/mapnik/markers_placements/interior.hpp b/include/mapnik/markers_placements/interior.hpp index 5d4144851..9fbc14cbc 100644 --- a/include/mapnik/markers_placements/interior.hpp +++ b/include/mapnik/markers_placements/interior.hpp @@ -49,12 +49,12 @@ public: return false; } - if (this->locator_.type() == new_geometry::geometry_types::Point) + if (this->locator_.type() == geometry::geometry_types::Point) { return markers_point_placement::get_point(x, y, angle, ignore_placement); } - if (this->locator_.type() == new_geometry::geometry_types::LineString) + if (this->locator_.type() == geometry::geometry_types::LineString) { if (!label::middle_point(this->locator_, x, y)) { diff --git a/include/mapnik/markers_placements/line.hpp b/include/mapnik/markers_placements/line.hpp index d14c93bc2..c8017b55a 100644 --- a/include/mapnik/markers_placements/line.hpp +++ b/include/mapnik/markers_placements/line.hpp @@ -68,7 +68,7 @@ public: return false; } - if (this->locator_.type() == new_geometry::geometry_types::Point) + if (this->locator_.type() == geometry::geometry_types::Point) { return markers_point_placement::get_point(x, y, angle, ignore_placement); } diff --git a/include/mapnik/markers_placements/point.hpp b/include/mapnik/markers_placements/point.hpp index ee6fa73b9..d4b15d0e1 100644 --- a/include/mapnik/markers_placements/point.hpp +++ b/include/mapnik/markers_placements/point.hpp @@ -79,7 +79,7 @@ public: return false; } - if (locator_.type() == new_geometry::geometry_types::LineString) + if (locator_.type() == geometry::geometry_types::LineString) { if (!label::middle_point(locator_, x, y)) { diff --git a/include/mapnik/markers_placements/vertext_first.hpp b/include/mapnik/markers_placements/vertext_first.hpp index cf033b23e..7c149ebb7 100644 --- a/include/mapnik/markers_placements/vertext_first.hpp +++ b/include/mapnik/markers_placements/vertext_first.hpp @@ -47,7 +47,7 @@ public: return false; } - if (this->locator_.type() == mapnik::new_geometry::geometry_types::Point) + if (this->locator_.type() == mapnik::geometry::geometry_types::Point) { return markers_point_placement::get_point(x, y, angle, ignore_placement); } diff --git a/include/mapnik/memory_featureset.hpp b/include/mapnik/memory_featureset.hpp index cd43591a4..25731acb5 100644 --- a/include/mapnik/memory_featureset.hpp +++ b/include/mapnik/memory_featureset.hpp @@ -78,8 +78,8 @@ public: } else { - new_geometry::geometry const& geom = (*pos_)->get_geometry(); - if (bbox_.intersects(new_geometry::envelope(geom))) + geometry::geometry const& geom = (*pos_)->get_geometry(); + if (bbox_.intersects(geometry::envelope(geom))) { return *pos_++; } diff --git a/include/mapnik/renderer_common/pattern_alignment.hpp b/include/mapnik/renderer_common/pattern_alignment.hpp index 42e7e8224..74d65ffa2 100644 --- a/include/mapnik/renderer_common/pattern_alignment.hpp +++ b/include/mapnik/renderer_common/pattern_alignment.hpp @@ -40,9 +40,9 @@ struct apply_local_alignment x_(x), y_(y) {} - void operator() (new_geometry::polygon_vertex_adapter & va) + void operator() (geometry::polygon_vertex_adapter & va) { - using clipped_geometry_type = agg::conv_clip_polygon; + using clipped_geometry_type = agg::conv_clip_polygon; using path_type = transform_path_adapter; clipped_geometry_type clipped(va); clipped.clip_box(clip_box_.minx(),clip_box_.miny(),clip_box_.maxx(),clip_box_.maxy()); diff --git a/include/mapnik/renderer_common/process_building_symbolizer.hpp b/include/mapnik/renderer_common/process_building_symbolizer.hpp index c12328162..336021a1b 100644 --- a/include/mapnik/renderer_common/process_building_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_building_symbolizer.hpp @@ -36,7 +36,7 @@ namespace mapnik { namespace detail { template -void make_building(new_geometry::polygon const& poly, double height, F1 const& face_func, F2 const& frame_func, F3 const& roof_func) +void make_building(geometry::polygon const& poly, double height, F1 const& face_func, F2 const& frame_func, F3 const& roof_func) { const std::unique_ptr frame(new path_type(path_type::types::LineString)); const std::unique_ptr roof(new path_type(path_type::types::Polygon)); @@ -44,7 +44,7 @@ void make_building(new_geometry::polygon const& poly, double height, F1 const& f double x0 = 0; double y0 = 0; double x,y; - new_geometry::polygon_vertex_adapter va(poly); + geometry::polygon_vertex_adapter va(poly); va.rewind(0); for (unsigned cm = va.vertex(&x, &y); cm != SEG_END; cm = va.vertex(&x, &y)) @@ -115,14 +115,14 @@ void render_building_symbolizer(mapnik::feature_impl const& feature, { auto const& geom = feature.get_geometry(); - if (geom.is()) + if (geom.is()) { - auto const& poly = geom.get(); + auto const& poly = geom.get(); detail::make_building(poly, height, face_func, frame_func, roof_func); } - else if (geom.is()) + else if (geom.is()) { - auto const& multi_poly = geom.get(); + auto const& multi_poly = geom.get(); for (auto const& poly : multi_poly) { detail::make_building(poly, height, face_func, frame_func, roof_func); diff --git a/include/mapnik/renderer_common/process_group_symbolizer.hpp b/include/mapnik/renderer_common/process_group_symbolizer.hpp index 05aa60325..74c448f93 100644 --- a/include/mapnik/renderer_common/process_group_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_group_symbolizer.hpp @@ -343,7 +343,7 @@ void render_group_symbolizer(group_symbolizer const& sym, // try to ensure that we don't get edge artefacts due to any // symbolizers with avoid-edges set: only the avoid-edges of // the group symbolizer itself should matter. - new_geometry::point origin_pt(x,y); + geometry::point origin_pt(x,y); sub_feature->set_geometry(origin_pt); // get the layout for this set of properties for (auto const& rule : props->get_rules()) diff --git a/include/mapnik/renderer_common/process_markers_symbolizer.hpp b/include/mapnik/renderer_common/process_markers_symbolizer.hpp index 6d4eae7e7..799fff7af 100644 --- a/include/mapnik/renderer_common/process_markers_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_markers_symbolizer.hpp @@ -117,10 +117,10 @@ struct render_marker_symbolizer_visitor common_.scale_factor_); if (clip) // optional clip (default: true) { - new_geometry::geometry_types type = new_geometry::geometry_type(feature_.get_geometry()); - if (type == new_geometry::geometry_types::Polygon) + geometry::geometry_types type = geometry::geometry_type(feature_.get_geometry()); + if (type == geometry::geometry_types::Polygon) converter.template set(); - else if (type == new_geometry::geometry_types::LineString) + else if (type == geometry::geometry_types::LineString) converter.template set(); } @@ -170,10 +170,10 @@ struct render_marker_symbolizer_visitor common_.scale_factor_); if (clip) // optional clip (default: true) { - new_geometry::geometry_types type = new_geometry::geometry_type(feature_.get_geometry()); - if (type == new_geometry::geometry_types::Polygon) + geometry::geometry_types type = geometry::geometry_type(feature_.get_geometry()); + if (type == geometry::geometry_types::Polygon) converter.template set(); - else if (type == new_geometry::geometry_types::LineString) + else if (type == geometry::geometry_types::LineString) converter.template set(); } @@ -235,10 +235,10 @@ struct render_marker_symbolizer_visitor if (clip) // optional clip (default: true) { - new_geometry::geometry_types type = new_geometry::geometry_type(feature_.get_geometry()); - if (type == new_geometry::geometry_types::Polygon) + geometry::geometry_types type = geometry::geometry_type(feature_.get_geometry()); + if (type == geometry::geometry_types::Polygon) converter.template set(); - else if (type == new_geometry::geometry_types::LineString) + else if (type == geometry::geometry_types::LineString) converter.template set(); } converter.template set(); //always transform diff --git a/include/mapnik/renderer_common/process_point_symbolizer.hpp b/include/mapnik/renderer_common/process_point_symbolizer.hpp index 821c45a14..8e6901a64 100644 --- a/include/mapnik/renderer_common/process_point_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_point_symbolizer.hpp @@ -63,11 +63,11 @@ void render_point_symbolizer(point_symbolizer const &sym, agg::trans_affine recenter_tr = recenter * tr; box2d label_ext = bbox * recenter_tr * agg::trans_affine_scaling(common.scale_factor_); - mapnik::new_geometry::geometry const& geometry = feature.get_geometry(); - mapnik::new_geometry::point pt; + mapnik::geometry::geometry const& geometry = feature.get_geometry(); + mapnik::geometry::point pt; if (placement == CENTROID_POINT_PLACEMENT) { - if (!new_geometry::centroid(geometry, pt)) return; + if (!geometry::centroid(geometry, pt)) return; } //else //{ diff --git a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp index 066de7861..f63250bb1 100644 --- a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp @@ -61,7 +61,7 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, if (smooth > 0.0) converter.template set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); diff --git a/include/mapnik/svg/geometry_svg_generator_impl.hpp b/include/mapnik/svg/geometry_svg_generator_impl.hpp index dcfb8cb91..f4c92810e 100644 --- a/include/mapnik/svg/geometry_svg_generator_impl.hpp +++ b/include/mapnik/svg/geometry_svg_generator_impl.hpp @@ -43,7 +43,7 @@ namespace mapnik { namespace svg { svg = point | linestring | polygon ; - point = &uint_(mapnik::new_geometry::geometry_types::Point)[_1 = _type(_val)] + point = &uint_(mapnik::geometry::geometry_types::Point)[_1 = _type(_val)] << svg_point [_1 = _first(_val)] ; @@ -53,11 +53,11 @@ namespace mapnik { namespace svg { << lit('\"') ; - linestring = &uint_(mapnik::new_geometry::geometry_types::LineString)[_1 = _type(_val)] + linestring = &uint_(mapnik::geometry::geometry_types::LineString)[_1 = _type(_val)] << lit("d=\"") << svg_path << lit("\"") ; - polygon = &uint_(mapnik::new_geometry::geometry_types::Polygon)[_1 = _type(_val)] + polygon = &uint_(mapnik::geometry::geometry_types::Polygon)[_1 = _type(_val)] << lit("d=\"") << svg_path << lit("\"") ; diff --git a/include/mapnik/text/symbolizer_helpers.hpp b/include/mapnik/text/symbolizer_helpers.hpp index 0a0d8e6e2..d24e84a05 100644 --- a/include/mapnik/text/symbolizer_helpers.hpp +++ b/include/mapnik/text/symbolizer_helpers.hpp @@ -88,11 +88,11 @@ protected: //Processing // Using list instead of vector, because we delete random elements and need iterators to stay valid. // Remaining geometries to be processed. - mutable std::list geometries_to_process_; + mutable std::list geometries_to_process_; // Remaining points to be processed. mutable std::list points_; // Geometry currently being processed. - mutable std::list::iterator geo_itr_; + mutable std::list::iterator geo_itr_; // Point currently being processed. mutable std::list::iterator point_itr_; // Use point placement. Otherwise line placement is used. diff --git a/include/mapnik/util/geometry_to_ds_type.hpp b/include/mapnik/util/geometry_to_ds_type.hpp index 78d141073..955314ff8 100644 --- a/include/mapnik/util/geometry_to_ds_type.hpp +++ b/include/mapnik/util/geometry_to_ds_type.hpp @@ -37,49 +37,49 @@ namespace detail { struct datasource_geometry_type { - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::geometry_empty const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::geometry_empty const&) const { return mapnik::datasource_geometry_t::Unknown; } - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::point const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::point const&) const { return mapnik::datasource_geometry_t::Point; } - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::line_string const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::line_string const&) const { return mapnik::datasource_geometry_t::LineString; } - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::polygon const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::polygon const&) const { return mapnik::datasource_geometry_t::Polygon; } - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::multi_point const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::multi_point const&) const { return mapnik::datasource_geometry_t::Point; } - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::multi_line_string const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::multi_line_string const&) const { return mapnik::datasource_geometry_t::LineString; } - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::multi_polygon const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::multi_polygon const&) const { return mapnik::datasource_geometry_t::Polygon; } - mapnik::datasource_geometry_t operator () (mapnik::new_geometry::geometry_collection const&) const + mapnik::datasource_geometry_t operator () (mapnik::geometry::geometry_collection const&) const { return mapnik::datasource_geometry_t::Collection; } }; } // detail -static inline mapnik::datasource_geometry_t to_ds_type(mapnik::new_geometry::geometry const& geom) +static inline mapnik::datasource_geometry_t to_ds_type(mapnik::geometry::geometry const& geom) { return util::apply_visitor(detail::datasource_geometry_type(), geom); } diff --git a/include/mapnik/util/geometry_to_geojson.hpp b/include/mapnik/util/geometry_to_geojson.hpp index ac4435650..6d554eda1 100644 --- a/include/mapnik/util/geometry_to_geojson.hpp +++ b/include/mapnik/util/geometry_to_geojson.hpp @@ -29,10 +29,10 @@ namespace mapnik { namespace util { -inline bool to_geojson(std::string & json, mapnik::new_geometry::geometry const& geom) +inline bool to_geojson(std::string & json, mapnik::geometry::geometry const& geom) { using sink_type = std::back_insert_iterator; - static const mapnik::json::geometry_generator_grammar grammar; + static const mapnik::json::geometry_generator_grammar grammar; sink_type sink(json); return boost::spirit::karma::generate(sink, grammar, geom); } diff --git a/include/mapnik/util/geometry_to_wkb.hpp b/include/mapnik/util/geometry_to_wkb.hpp index c383f9de5..5faa24e5b 100644 --- a/include/mapnik/util/geometry_to_wkb.hpp +++ b/include/mapnik/util/geometry_to_wkb.hpp @@ -131,20 +131,20 @@ struct wkb_buffer using wkb_buffer_ptr = std::unique_ptr; -wkb_buffer_ptr point_wkb( new_geometry::point const& pt, wkbByteOrder byte_order) +wkb_buffer_ptr point_wkb( geometry::point const& pt, wkbByteOrder byte_order) { std::size_t size = 1 + 4 + 8 * 2 ; // byteOrder + wkbType + Point wkb_buffer_ptr wkb = std::make_unique(size); wkb_stream ss(wkb->buffer(), wkb->size()); ss.write(reinterpret_cast(&byte_order),1); - write(ss, static_cast(new_geometry::geometry_types::Point), 4 , byte_order); + write(ss, static_cast(geometry::geometry_types::Point), 4 , byte_order); write(ss, pt.x, 8, byte_order); write(ss, pt.y, 8, byte_order); assert(ss.good()); return std::move(wkb); } -wkb_buffer_ptr line_string_wkb(new_geometry::line_string const& line, wkbByteOrder byte_order) +wkb_buffer_ptr line_string_wkb(geometry::line_string const& line, wkbByteOrder byte_order) { unsigned num_points = line.size(); assert(num_points > 1); @@ -152,11 +152,11 @@ wkb_buffer_ptr line_string_wkb(new_geometry::line_string const& line, wkbByteOrd wkb_buffer_ptr wkb = std::make_unique(size); wkb_stream ss(wkb->buffer(), wkb->size()); ss.write(reinterpret_cast(&byte_order),1); - write(ss, static_cast(mapnik::new_geometry::geometry_types::LineString) , 4, byte_order); + write(ss, static_cast(mapnik::geometry::geometry_types::LineString) , 4, byte_order); write(ss, num_points, 4, byte_order); for (unsigned i=0; i< num_points; ++i) { - new_geometry::point const& pt = line[i]; + geometry::point const& pt = line[i]; write(ss, pt.x, 8, byte_order); write(ss, pt.y, 8, byte_order); } @@ -164,7 +164,7 @@ wkb_buffer_ptr line_string_wkb(new_geometry::line_string const& line, wkbByteOrd return std::move(wkb); } -wkb_buffer_ptr polygon_wkb( new_geometry::polygon const& poly, wkbByteOrder byte_order) +wkb_buffer_ptr polygon_wkb( geometry::polygon const& poly, wkbByteOrder byte_order) { std::size_t size = 1 + 4 + 4 ; // byteOrder + wkbType + numRings size += 4 + 2 * 8 * poly.exterior_ring.size(); @@ -177,7 +177,7 @@ wkb_buffer_ptr polygon_wkb( new_geometry::polygon const& poly, wkbByteOrder byte wkb_buffer_ptr wkb = std::make_unique(size); wkb_stream ss(wkb->buffer(), wkb->size()); ss.write(reinterpret_cast(&byte_order),1); - write(ss, static_cast(mapnik::new_geometry::geometry_types::Polygon), 4, byte_order); + write(ss, static_cast(mapnik::geometry::geometry_types::Polygon), 4, byte_order); write(ss, poly.num_rings(), 4, byte_order); // exterior @@ -202,18 +202,18 @@ wkb_buffer_ptr polygon_wkb( new_geometry::polygon const& poly, wkbByteOrder byte return std::move(wkb); } -wkb_buffer_ptr multi_point_wkb( new_geometry::multi_point const& multi_pt, wkbByteOrder byte_order) +wkb_buffer_ptr multi_point_wkb( geometry::multi_point const& multi_pt, wkbByteOrder byte_order) { std::size_t size = 1 + 4 + 4 + (1 + 4 + 8 * 2) * multi_pt.size() ; // byteOrder + wkbType + num_point + Point.size * num_points wkb_buffer_ptr wkb = std::make_unique(size); wkb_stream ss(wkb->buffer(), wkb->size()); ss.write(reinterpret_cast(&byte_order),1); - write(ss, static_cast(new_geometry::geometry_types::MultiPoint), 4, byte_order); + write(ss, static_cast(geometry::geometry_types::MultiPoint), 4, byte_order); write(ss, multi_pt.size(), 4 ,byte_order); for (auto const& pt : multi_pt) { ss.write(reinterpret_cast(&byte_order),1); - write(ss, static_cast(new_geometry::geometry_types::Point), 4, byte_order); + write(ss, static_cast(geometry::geometry_types::Point), 4, byte_order); write(ss, pt.x, 8, byte_order); write(ss, pt.y, 8, byte_order); } @@ -232,34 +232,34 @@ struct geometry_to_wkb geometry_to_wkb(wkbByteOrder byte_order) : byte_order_(byte_order) {} - result_type operator() (new_geometry::geometry const& geom) const + result_type operator() (geometry::geometry const& geom) const { return util::apply_visitor(*this, geom); } - result_type operator() (new_geometry::geometry_empty const&) const + result_type operator() (geometry::geometry_empty const&) const { return result_type(); } - result_type operator() (new_geometry::point const& pt) const + result_type operator() (geometry::point const& pt) const { return point_wkb(pt, byte_order_); } - result_type operator() (new_geometry::line_string const& line) const + result_type operator() (geometry::line_string const& line) const { return line_string_wkb(line, byte_order_); } - result_type operator() (new_geometry::polygon const& poly) const + result_type operator() (geometry::polygon const& poly) const { return polygon_wkb(poly, byte_order_); } // multi/collection - result_type operator() (new_geometry::multi_point const& multi_pt) const + result_type operator() (geometry::multi_point const& multi_pt) const { return multi_point_wkb(multi_pt, byte_order_); } @@ -287,7 +287,7 @@ wkb_buffer_ptr multi_geom_wkb(MultiGeometry const& multi_geom, wkbByteOrder byte wkb_buffer_ptr multi_wkb = std::make_unique(multi_size); wkb_stream ss(multi_wkb->buffer(), multi_wkb->size()); ss.write(reinterpret_cast(&byte_order),1); - write(ss, static_cast(new_geometry::detail::geometry_type()(multi_geom)) , 4, byte_order); + write(ss, static_cast(geometry::detail::geometry_type()(multi_geom)) , 4, byte_order); write(ss, multi_geom.size(), 4 ,byte_order); for ( wkb_buffer_ptr const& wkb : wkb_cont) diff --git a/include/mapnik/util/spirit_transform_attribute.hpp b/include/mapnik/util/spirit_transform_attribute.hpp index a70a5f1e6..eb0ea94b3 100644 --- a/include/mapnik/util/spirit_transform_attribute.hpp +++ b/include/mapnik/util/spirit_transform_attribute.hpp @@ -28,90 +28,90 @@ namespace boost { namespace spirit { namespace traits { template <> - struct transform_attribute + struct transform_attribute { - using type = mapnik::new_geometry::point const&; - static type pre(mapnik::new_geometry::geometry const& geom) + using type = mapnik::geometry::point const&; + static type pre(mapnik::geometry::geometry const& geom) { - return mapnik::util::get(geom); + return mapnik::util::get(geom); } }; template <> - struct transform_attribute + struct transform_attribute { - using type = mapnik::new_geometry::line_string const&; - static type pre(mapnik::new_geometry::geometry const& geom) + using type = mapnik::geometry::line_string const&; + static type pre(mapnik::geometry::geometry const& geom) { - return mapnik::util::get(geom); + return mapnik::util::get(geom); } }; template <> - struct transform_attribute + struct transform_attribute { - using type = mapnik::new_geometry::polygon const&; - static type pre(mapnik::new_geometry::geometry const& geom) + using type = mapnik::geometry::polygon const&; + static type pre(mapnik::geometry::geometry const& geom) { - return mapnik::util::get(geom); + return mapnik::util::get(geom); } }; template <> - struct transform_attribute const&, karma::domain> + struct transform_attribute const&, karma::domain> { - using type = std::vector const&; - static type pre(mapnik::new_geometry::polygon const& poly) + using type = std::vector const&; + static type pre(mapnik::geometry::polygon const& poly) { return poly.interior_rings; } }; template <> - struct transform_attribute + struct transform_attribute { - using type = mapnik::new_geometry::multi_point const&; - static type pre(mapnik::new_geometry::geometry const& geom) + using type = mapnik::geometry::multi_point const&; + static type pre(mapnik::geometry::geometry const& geom) { - return mapnik::util::get(geom); + return mapnik::util::get(geom); } }; template <> - struct transform_attribute + struct transform_attribute { - using type = mapnik::new_geometry::multi_line_string const&; - static type pre(mapnik::new_geometry::geometry const& geom) + using type = mapnik::geometry::multi_line_string const&; + static type pre(mapnik::geometry::geometry const& geom) { - return mapnik::util::get(geom); + return mapnik::util::get(geom); } }; template <> - struct transform_attribute + struct transform_attribute { - using type = mapnik::new_geometry::multi_polygon const&; - static type pre(mapnik::new_geometry::geometry const& geom) + using type = mapnik::geometry::multi_polygon const&; + static type pre(mapnik::geometry::geometry const& geom) { - return mapnik::util::get(geom); + return mapnik::util::get(geom); } }; template <> - struct transform_attribute + struct transform_attribute { - using type = mapnik::new_geometry::geometry_collection const&; - static type pre(mapnik::new_geometry::geometry const& geom) + using type = mapnik::geometry::geometry_collection const&; + static type pre(mapnik::geometry::geometry const& geom) { - return mapnik::util::get(geom); + return mapnik::util::get(geom); } }; diff --git a/include/mapnik/vertex_processor.hpp b/include/mapnik/vertex_processor.hpp index da43dbb97..a4b211e8c 100644 --- a/include/mapnik/vertex_processor.hpp +++ b/include/mapnik/vertex_processor.hpp @@ -25,7 +25,7 @@ #include -namespace mapnik { namespace new_geometry { +namespace mapnik { namespace geometry { template struct vertex_processor diff --git a/include/mapnik/wkb.hpp b/include/mapnik/wkb.hpp index eceaa1ab7..953386957 100644 --- a/include/mapnik/wkb.hpp +++ b/include/mapnik/wkb.hpp @@ -59,7 +59,7 @@ class MAPNIK_DECL geometry_utils : private util::noncopyable { public: - static mapnik::new_geometry::geometry from_wkb(const char* wkb, + static mapnik::geometry::geometry from_wkb(const char* wkb, unsigned size, wkbFormat format = wkbGeneric); }; diff --git a/include/mapnik/wkt/wkt_factory.hpp b/include/mapnik/wkt/wkt_factory.hpp index 9aa07a472..6a129d2f1 100644 --- a/include/mapnik/wkt/wkt_factory.hpp +++ b/include/mapnik/wkt/wkt_factory.hpp @@ -35,7 +35,7 @@ namespace mapnik { -inline bool from_wkt(std::string const& wkt, mapnik::new_geometry::geometry & geom) +inline bool from_wkt(std::string const& wkt, mapnik::geometry::geometry & geom) { using namespace boost::spirit; static const mapnik::wkt::wkt_grammar g; @@ -45,10 +45,10 @@ inline bool from_wkt(std::string const& wkt, mapnik::new_geometry::geometry & ge return qi::phrase_parse(first, last, (g)(boost::phoenix::ref(geom)), space); } -inline bool to_wkt(std::string & wkt, mapnik::new_geometry::geometry const& geom) +inline bool to_wkt(std::string & wkt, mapnik::geometry::geometry const& geom) { using sink_type = std::back_insert_iterator; - static const mapnik::wkt::wkt_generator_grammar generator; + static const mapnik::wkt::wkt_generator_grammar generator; sink_type sink(wkt); return boost::spirit::karma::generate(sink, generator, geom); } diff --git a/include/mapnik/wkt/wkt_generator_grammar.hpp b/include/mapnik/wkt/wkt_generator_grammar.hpp index de4f0bc20..3b685f417 100644 --- a/include/mapnik/wkt/wkt_generator_grammar.hpp +++ b/include/mapnik/wkt/wkt_generator_grammar.hpp @@ -49,11 +49,11 @@ namespace detail { template struct get_type { - using result_type = mapnik::new_geometry::geometry_types; + using result_type = mapnik::geometry::geometry_types; template result_type operator() (T const& geom) const { - auto type = mapnik::new_geometry::geometry_type(geom); + auto type = mapnik::geometry::geometry_type(geom); return type; } }; @@ -94,25 +94,25 @@ struct wkt_generator_grammar : wkt_generator_grammar(); // rules karma::rule geometry; - karma::rule, Geometry const&() > geometry_dispatch; - karma::rule point; - karma::rule point_coord; - karma::rule linestring; - karma::rule linestring_coord; - karma::rule polygon; - karma::rule polygon_coord; - karma::rule exterior_ring_coord; - karma::rule const&()> interior_ring_coord; - karma::rule multi_point; - karma::rule multi_point_coord; - karma::rule multi_linestring; - karma::rule multi_linestring_coord; - karma::rule multi_polygon; - karma::rule multi_polygon_coord; - karma::rule geometry_collection; - karma::rule geometries; + karma::rule, Geometry const&() > geometry_dispatch; + karma::rule point; + karma::rule point_coord; + karma::rule linestring; + karma::rule linestring_coord; + karma::rule polygon; + karma::rule polygon_coord; + karma::rule exterior_ring_coord; + karma::rule const&()> interior_ring_coord; + karma::rule multi_point; + karma::rule multi_point_coord; + karma::rule multi_linestring; + karma::rule multi_linestring_coord; + karma::rule multi_polygon; + karma::rule multi_polygon_coord; + karma::rule geometry_collection; + karma::rule geometries; boost::phoenix::function > geometry_type; - karma::symbols empty; + karma::symbols empty; // karma::real_generator > coordinate; }; diff --git a/include/mapnik/wkt/wkt_generator_grammar_impl.hpp b/include/mapnik/wkt/wkt_generator_grammar_impl.hpp index 178c86cab..bcbebc473 100644 --- a/include/mapnik/wkt/wkt_generator_grammar_impl.hpp +++ b/include/mapnik/wkt/wkt_generator_grammar_impl.hpp @@ -40,38 +40,38 @@ wkt_generator_grammar::wkt_generator_grammar() boost::spirit::karma::eps_type eps; empty.add - (new_geometry::geometry_types::Point, "POINT EMPTY") - (new_geometry::geometry_types::LineString, "LINESTRING EMPTY") - (new_geometry::geometry_types::Polygon, "POLYGON EMPTY") - (new_geometry::geometry_types::MultiPoint, "MULTIPOINT EMPTY") - (new_geometry::geometry_types::MultiLineString, "MULTILINESTRING EMPTY") - (new_geometry::geometry_types::MultiPolygon, "MULTIPOLYGON EMPTY") - (new_geometry::geometry_types::GeometryCollection, "GEOMETRYCOLLECTION EMPTY") + (geometry::geometry_types::Point, "POINT EMPTY") + (geometry::geometry_types::LineString, "LINESTRING EMPTY") + (geometry::geometry_types::Polygon, "POLYGON EMPTY") + (geometry::geometry_types::MultiPoint, "MULTIPOINT EMPTY") + (geometry::geometry_types::MultiLineString, "MULTILINESTRING EMPTY") + (geometry::geometry_types::MultiPolygon, "MULTIPOLYGON EMPTY") + (geometry::geometry_types::GeometryCollection, "GEOMETRYCOLLECTION EMPTY") ; geometry = geometry_dispatch.alias() ; geometry_dispatch = eps[_a = geometry_type(_val)] << - (&uint_(new_geometry::geometry_types::Point)[_1 = _a] + (&uint_(geometry::geometry_types::Point)[_1 = _a] << (point | empty[_1 = _a])) | - (&uint_(new_geometry::geometry_types::LineString)[_1 = _a] + (&uint_(geometry::geometry_types::LineString)[_1 = _a] << (linestring | empty[_1 = _a])) | - (&uint_(new_geometry::geometry_types::Polygon)[_1 = _a] + (&uint_(geometry::geometry_types::Polygon)[_1 = _a] << (polygon | empty[_1 = _a])) | - (&uint_(new_geometry::geometry_types::MultiPoint)[_1 = _a] + (&uint_(geometry::geometry_types::MultiPoint)[_1 = _a] << ( multi_point | empty[_1 = _a])) | - (&uint_(new_geometry::geometry_types::MultiLineString)[_1 = _a] + (&uint_(geometry::geometry_types::MultiLineString)[_1 = _a] << (multi_linestring | empty[_1 = _a])) | - (&uint_(new_geometry::geometry_types::MultiPolygon)[_1 = _a] + (&uint_(geometry::geometry_types::MultiPolygon)[_1 = _a] << (multi_polygon | empty[_1 = _a])) | - (&uint_(new_geometry::geometry_types::GeometryCollection)[_1 = _a] + (&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a] << (geometry_collection | empty[_1 = _a])) ; diff --git a/include/mapnik/wkt/wkt_grammar.hpp b/include/mapnik/wkt/wkt_grammar.hpp index f60c1d757..b731ca8a7 100644 --- a/include/mapnik/wkt/wkt_grammar.hpp +++ b/include/mapnik/wkt/wkt_grammar.hpp @@ -85,29 +85,29 @@ struct add_hole } template -struct wkt_grammar : qi::grammar +struct wkt_grammar : qi::grammar { wkt_grammar(); - qi::rule geometry_tagged_text; - qi::rule point_tagged_text; - qi::rule linestring_tagged_text; - qi::rule polygon_tagged_text; - qi::rule multipoint_tagged_text; - qi::rule multilinestring_tagged_text; - qi::rule multipolygon_tagged_text; - qi::rule geometrycollection_tagged_text; - qi::rule point_text; - qi::rule linestring_text; - qi::rule linearring_text; - qi::rule polygon_text; - qi::rule multipoint_text; - qi::rule multilinestring_text; - qi::rule multipolygon_text; - qi::rule, - mapnik::new_geometry::geometry_collection(), ascii::space_type> geometrycollection_text; - qi::rule point; - qi::rule points; - qi::rule ring_points; + qi::rule geometry_tagged_text; + qi::rule point_tagged_text; + qi::rule linestring_tagged_text; + qi::rule polygon_tagged_text; + qi::rule multipoint_tagged_text; + qi::rule multilinestring_tagged_text; + qi::rule multipolygon_tagged_text; + qi::rule geometrycollection_tagged_text; + qi::rule point_text; + qi::rule linestring_text; + qi::rule linearring_text; + qi::rule polygon_text; + qi::rule multipoint_text; + qi::rule multilinestring_text; + qi::rule multipolygon_text; + qi::rule, + mapnik::geometry::geometry_collection(), ascii::space_type> geometrycollection_text; + qi::rule point; + qi::rule points; + qi::rule ring_points; qi::rule empty_set; boost::phoenix::function assign; boost::phoenix::function move_part; diff --git a/include/mapnik/wkt/wkt_grammar_impl.hpp b/include/mapnik/wkt/wkt_grammar_impl.hpp index 851d7b849..736c7e588 100644 --- a/include/mapnik/wkt/wkt_grammar_impl.hpp +++ b/include/mapnik/wkt/wkt_grammar_impl.hpp @@ -131,7 +131,7 @@ wkt_grammar::wkt_grammar() // geometry collection text geometrycollection_text = (lit('(') - >> ( eps[_a = construct()] + >> ( eps[_a = construct()] >> geometry_tagged_text(_a)[move_part(_val,_a)] % lit(',')) >> lit(')')) | diff --git a/plugins/input/csv/csv_datasource.cpp b/plugins/input/csv/csv_datasource.cpp index f6759abff..e692eb427 100644 --- a/plugins/input/csv/csv_datasource.cpp +++ b/plugins/input/csv/csv_datasource.cpp @@ -541,11 +541,11 @@ void csv_datasource::parse_csv(T & stream, { break; } - mapnik::new_geometry::geometry geom; + mapnik::geometry::geometry geom; if (mapnik::from_wkt(value, geom)) { // correct orientations etc - mapnik::new_geometry::correct(geom); + mapnik::geometry::correct(geom); // set geometry feature->set_geometry(std::move(geom)); parsed_wkt = true; @@ -581,7 +581,7 @@ void csv_datasource::parse_csv(T & stream, { break; } - mapnik::new_geometry::geometry geom; + mapnik::geometry::geometry geom; if (mapnik::json::from_geojson(value, geom)) { feature->set_geometry(std::move(geom)); @@ -816,7 +816,7 @@ void csv_datasource::parse_csv(T & stream, { if (parsed_x && parsed_y) { - mapnik::new_geometry::point pt(x,y); + mapnik::geometry::point pt(x,y); feature->set_geometry(std::move(pt)); features_.push_back(feature); null_geom = false; diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index aeee67111..a0d1a8132 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -613,7 +613,7 @@ feature_ptr gdal_featureset::get_feature_at_point(mapnik::coord2d const& pt) { // construct feature feature_ptr feature = feature_factory::create(ctx_,1); - feature->set_geometry(mapnik::new_geometry::point(pt.x,pt.y)); + feature->set_geometry(mapnik::geometry::point(pt.x,pt.y)); feature->put_new("value",value); if (raster_has_nodata) { diff --git a/plugins/input/occi/occi_featureset.cpp b/plugins/input/occi/occi_featureset.cpp index 6d3b4e410..1c01140fd 100644 --- a/plugins/input/occi/occi_featureset.cpp +++ b/plugins/input/occi/occi_featureset.cpp @@ -259,7 +259,7 @@ void occi_featureset::convert_geometry(SDOGeometry* geom, feature_ptr feature) SDOPointType* sdopoint = geom->getSdo_point(); if (sdopoint && ! sdopoint->isNull()) { - std::unique_ptr point = std::make_unique(mapnik::new_geometry::geometry_types::Point); + std::unique_ptr point = std::make_unique(mapnik::geometry::geometry_types::Point); point->move_to(sdopoint->getX(), sdopoint->getY()); feature->add_geometry(point.release()); } @@ -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::new_geometry::geometry_types::LineString, + mapnik::geometry::geometry_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::new_geometry::geometry_types::Polygon, + mapnik::geometry::geometry_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::new_geometry::geometry_types::Point, + mapnik::geometry::geometry_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::new_geometry::geometry_types::LineString, + mapnik::geometry::geometry_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::new_geometry::geometry_types::Polygon, + mapnik::geometry::geometry_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::new_geometry::geometry_types::Polygon, + mapnik::geometry::geometry_types::Polygon, elem_info, ordinates, 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_type::types gtype = mapnik::new_geometry::geometry_types::Point; + mapnik::geometry_type::types gtype = mapnik::geometry::geometry_types::Point; switch (etype) { case SDO_ETYPE_POINT: if (interp == SDO_INTERPRETATION_POINT) {} if (interp > SDO_INTERPRETATION_POINT) {} - gtype = mapnik::new_geometry::geometry_types::Point; + gtype = mapnik::geometry::geometry_types::Point; break; case SDO_ETYPE_LINESTRING: if (interp == SDO_INTERPRETATION_STRAIGHT) {} if (interp == SDO_INTERPRETATION_CIRCULAR) {} - gtype = mapnik::new_geometry::geometry_types::LineString; + gtype = mapnik::geometry::geometry_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::new_geometry::geometry_types::Polygon; + gtype = mapnik::geometry::geometry_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::new_geometry::geometry_types::Polygon; + gtype = mapnik::geometry::geometry_types::Polygon; break; case SDO_ETYPE_UNKNOWN: // unknown diff --git a/plugins/input/ogr/ogr_converter.cpp b/plugins/input/ogr/ogr_converter.cpp index 97d88d461..3da62ff11 100644 --- a/plugins/input/ogr/ogr_converter.cpp +++ b/plugins/input/ogr/ogr_converter.cpp @@ -29,7 +29,7 @@ #include #include -mapnik::new_geometry::geometry ogr_converter::convert_geometry(OGRGeometry* ogr_geom) +mapnik::geometry::geometry ogr_converter::convert_geometry(OGRGeometry* ogr_geom) { // NOTE: wkbFlatten macro in ogr flattens 2.5d types into base 2d type switch (wkbFlatten(ogr_geom->getGeometryType())) @@ -65,19 +65,19 @@ mapnik::new_geometry::geometry ogr_converter::convert_geometry(OGRGeometry* ogr_ MAPNIK_LOG_WARN(ogr) << "ogr_converter: unknown geometry_type=" << wkbFlatten(ogr_geom->getGeometryType()); } - return mapnik::new_geometry::geometry(); + return mapnik::geometry::geometry(); break; } } -mapnik::new_geometry::point ogr_converter::convert_point(OGRPoint* ogr_geom) +mapnik::geometry::point ogr_converter::convert_point(OGRPoint* ogr_geom) { - return mapnik::new_geometry::point(ogr_geom->getX(), ogr_geom->getY()); + return mapnik::geometry::point(ogr_geom->getX(), ogr_geom->getY()); } -mapnik::new_geometry::multi_point ogr_converter::convert_multipoint(OGRMultiPoint* ogr_geom) +mapnik::geometry::multi_point ogr_converter::convert_multipoint(OGRMultiPoint* ogr_geom) { - mapnik::new_geometry::multi_point geom; + mapnik::geometry::multi_point geom; int num_geometries = ogr_geom->getNumGeometries(); geom.reserve(num_geometries); for (int i = 0; i < num_geometries; ++i) @@ -88,9 +88,9 @@ mapnik::new_geometry::multi_point ogr_converter::convert_multipoint(OGRMultiPoin return geom; } -mapnik::new_geometry::line_string ogr_converter::convert_linestring(OGRLineString* ogr_geom) +mapnik::geometry::line_string ogr_converter::convert_linestring(OGRLineString* ogr_geom) { - mapnik::new_geometry::line_string geom; + mapnik::geometry::line_string geom; int num_points = ogr_geom->getNumPoints(); geom.reserve(num_points); for (int i = 0; i < num_points; ++i) @@ -100,9 +100,9 @@ mapnik::new_geometry::line_string ogr_converter::convert_linestring(OGRLineStrin return geom; } -mapnik::new_geometry::multi_line_string ogr_converter::convert_multilinestring(OGRMultiLineString* ogr_geom) +mapnik::geometry::multi_line_string ogr_converter::convert_multilinestring(OGRMultiLineString* ogr_geom) { - mapnik::new_geometry::multi_line_string geom; + mapnik::geometry::multi_line_string geom; int num_geometries = ogr_geom->getNumGeometries(); geom.reserve(num_geometries); for (int i = 0; i < num_geometries; ++i) @@ -114,10 +114,10 @@ mapnik::new_geometry::multi_line_string ogr_converter::convert_multilinestring(O } -mapnik::new_geometry::polygon ogr_converter::convert_polygon(OGRPolygon* ogr_geom) +mapnik::geometry::polygon ogr_converter::convert_polygon(OGRPolygon* ogr_geom) { - mapnik::new_geometry::polygon geom; - mapnik::new_geometry::linear_ring exterior; + mapnik::geometry::polygon geom; + mapnik::geometry::linear_ring exterior; OGRLinearRing* ogr_exterior = ogr_geom->getExteriorRing(); int num_points = ogr_exterior->getNumPoints(); exterior.reserve(num_points); @@ -131,7 +131,7 @@ mapnik::new_geometry::polygon ogr_converter::convert_polygon(OGRPolygon* ogr_geo for (int r = 0; r < num_interior; ++r) { OGRLinearRing* ogr_interior = ogr_geom->getInteriorRing(r); - mapnik::new_geometry::linear_ring interior; + mapnik::geometry::linear_ring interior; int num_interior_points = ogr_interior->getNumPoints(); interior.reserve(num_interior_points); for (int i = 0; i < num_interior_points; ++i) @@ -143,9 +143,9 @@ mapnik::new_geometry::polygon ogr_converter::convert_polygon(OGRPolygon* ogr_geo return geom; } -mapnik::new_geometry::multi_polygon ogr_converter::convert_multipolygon(OGRMultiPolygon* ogr_geom) +mapnik::geometry::multi_polygon ogr_converter::convert_multipolygon(OGRMultiPolygon* ogr_geom) { - mapnik::new_geometry::multi_polygon geom; + mapnik::geometry::multi_polygon geom; int num_geometries = ogr_geom->getNumGeometries(); geom.reserve(num_geometries); for (int i = 0; i < num_geometries; ++i) @@ -156,9 +156,9 @@ mapnik::new_geometry::multi_polygon ogr_converter::convert_multipolygon(OGRMulti return geom; } -mapnik::new_geometry::geometry_collection ogr_converter::convert_collection(OGRGeometryCollection* ogr_geom) +mapnik::geometry::geometry_collection ogr_converter::convert_collection(OGRGeometryCollection* ogr_geom) { - mapnik::new_geometry::geometry_collection geom; + mapnik::geometry::geometry_collection geom; int num_geometries = ogr_geom->getNumGeometries(); geom.reserve(num_geometries); for (int i = 0; i < num_geometries; ++i) diff --git a/plugins/input/ogr/ogr_converter.hpp b/plugins/input/ogr/ogr_converter.hpp index 75b154e2c..c55f78aa0 100644 --- a/plugins/input/ogr/ogr_converter.hpp +++ b/plugins/input/ogr/ogr_converter.hpp @@ -39,14 +39,14 @@ class ogr_converter { public: - static mapnik::new_geometry::geometry convert_geometry (OGRGeometry* ogr_geom); - static mapnik::new_geometry::point convert_point (OGRPoint* ogr_geom); - static mapnik::new_geometry::multi_point convert_multipoint (OGRMultiPoint* ogr_geom); - static mapnik::new_geometry::line_string convert_linestring (OGRLineString* ogr_geom); - static mapnik::new_geometry::multi_line_string convert_multilinestring (OGRMultiLineString* ogr_geom); - static mapnik::new_geometry::polygon convert_polygon (OGRPolygon* ogr_geom); - static mapnik::new_geometry::multi_polygon convert_multipolygon (OGRMultiPolygon* ogr_geom); - static mapnik::new_geometry::geometry_collection convert_collection (OGRGeometryCollection* ogr_geom); + static mapnik::geometry::geometry convert_geometry (OGRGeometry* ogr_geom); + static mapnik::geometry::point convert_point (OGRPoint* ogr_geom); + static mapnik::geometry::multi_point convert_multipoint (OGRMultiPoint* ogr_geom); + static mapnik::geometry::line_string convert_linestring (OGRLineString* ogr_geom); + static mapnik::geometry::multi_line_string convert_multilinestring (OGRMultiLineString* ogr_geom); + static mapnik::geometry::polygon convert_polygon (OGRPolygon* ogr_geom); + static mapnik::geometry::multi_polygon convert_multipolygon (OGRMultiPolygon* ogr_geom); + static mapnik::geometry::geometry_collection convert_collection (OGRGeometryCollection* ogr_geom); }; #endif // OGR_CONVERTER_HPP diff --git a/plugins/input/osm/osm_featureset.cpp b/plugins/input/osm/osm_featureset.cpp index dd877b76c..1123e35cd 100644 --- a/plugins/input/osm/osm_featureset.cpp +++ b/plugins/input/osm/osm_featureset.cpp @@ -63,7 +63,7 @@ feature_ptr osm_featureset::next() feature = feature_factory::create(ctx_, cur_item->id); double lat = static_cast(cur_item)->lat; double lon = static_cast(cur_item)->lon; - feature->set_geometry(mapnik::new_geometry::point(lon,lat)); + feature->set_geometry(mapnik::geometry::point(lon,lat)); } else if (dataset_->current_item_is_way()) { @@ -81,7 +81,7 @@ feature_ptr osm_featureset::next() feature = feature_factory::create(ctx_, cur_item->id); if (static_cast(cur_item)->is_polygon()) { - mapnik::new_geometry::linear_ring ring; + mapnik::geometry::linear_ring ring; for (unsigned int count = 0; count < static_cast(cur_item)->nodes.size(); count++) @@ -89,13 +89,13 @@ feature_ptr osm_featureset::next() ring.add_coord(static_cast(cur_item)->nodes[count]->lon, static_cast(cur_item)->nodes[count]->lat); } - mapnik::new_geometry::polygon geom; + mapnik::geometry::polygon geom; geom.set_exterior_ring(std::move(ring)); feature->set_geometry(std::move(geom)); } else { - mapnik::new_geometry::line_string geom; + mapnik::geometry::line_string geom; for (unsigned int count = 0; count < static_cast(cur_item)->nodes.size(); count++) diff --git a/plugins/input/postgis/postgis_featureset.cpp b/plugins/input/postgis/postgis_featureset.cpp index 1b84abd0f..1be31f07a 100644 --- a/plugins/input/postgis/postgis_featureset.cpp +++ b/plugins/input/postgis/postgis_featureset.cpp @@ -122,7 +122,7 @@ feature_ptr postgis_featureset::next() int size = rs_->getFieldLength(0); const char *data = rs_->getValue(0); - mapnik::new_geometry::geometry geometry = geometry_utils::from_wkb(data, size); + mapnik::geometry::geometry geometry = geometry_utils::from_wkb(data, size); feature->set_geometry(std::move(geometry)); totalGeomSize_ += size; diff --git a/plugins/input/shape/shape_featureset.cpp b/plugins/input/shape/shape_featureset.cpp index 988ac8a76..488573260 100644 --- a/plugins/input/shape/shape_featureset.cpp +++ b/plugins/input/shape/shape_featureset.cpp @@ -87,7 +87,7 @@ feature_ptr shape_featureset::next() double y = record.read_double(); if (!filter_.pass(mapnik::box2d(x,y,x,y))) continue; - feature->set_geometry(mapnik::new_geometry::point(x,y)); + feature->set_geometry(mapnik::geometry::point(x,y)); break; } case shape_io::shape_multipoint: @@ -97,12 +97,12 @@ feature_ptr shape_featureset::next() shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; int num_points = record.read_ndr_integer(); - mapnik::new_geometry::multi_point multi_point; + mapnik::geometry::multi_point multi_point; for (int i = 0; i < num_points; ++i) { double x = record.read_double(); double y = record.read_double(); - multi_point.emplace_back(mapnik::new_geometry::point(x, y)); + multi_point.emplace_back(mapnik::geometry::point(x, y)); } feature->set_geometry(std::move(multi_point)); break; diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index a9b01f34e..1cd0b9e6f 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -103,7 +103,7 @@ feature_ptr shape_index_featureset::next() { double x = record.read_double(); double y = record.read_double(); - feature->set_geometry(mapnik::new_geometry::point(x,y)); + feature->set_geometry(mapnik::geometry::point(x,y)); break; } case shape_io::shape_multipoint: @@ -113,12 +113,12 @@ feature_ptr shape_index_featureset::next() shape_io::read_bbox(record, feature_bbox_); if (!filter_.pass(feature_bbox_)) continue; int num_points = record.read_ndr_integer(); - mapnik::new_geometry::multi_point multi_point; + mapnik::geometry::multi_point multi_point; for (int i = 0; i < num_points; ++i) { double x = record.read_double(); double y = record.read_double(); - multi_point.emplace_back(mapnik::new_geometry::point(x, y)); + multi_point.emplace_back(mapnik::geometry::point(x, y)); } feature->set_geometry(std::move(multi_point)); break; diff --git a/plugins/input/shape/shape_io.cpp b/plugins/input/shape/shape_io.cpp index fcc9f7b78..239974f30 100644 --- a/plugins/input/shape/shape_io.cpp +++ b/plugins/input/shape/shape_io.cpp @@ -89,7 +89,7 @@ void shape_io::read_bbox(shape_file::record_type & record, mapnik::box2d bbox.init(lox, loy, hix, hiy); } -mapnik::new_geometry::geometry shape_io::read_polyline(shape_file::record_type & record) +mapnik::geometry::geometry shape_io::read_polyline(shape_file::record_type & record) { int num_parts = record.read_ndr_integer(); int num_points = record.read_ndr_integer(); @@ -97,7 +97,7 @@ mapnik::new_geometry::geometry shape_io::read_polyline(shape_file::record_type & if (num_parts == 1) { - mapnik::new_geometry::line_string line; + mapnik::geometry::line_string line; line.reserve(num_points); record.skip(4); for (int i = 0; i < num_points; ++i) @@ -106,7 +106,7 @@ mapnik::new_geometry::geometry shape_io::read_polyline(shape_file::record_type & double y = record.read_double(); line.add_coord(x, y); } - return std::move(mapnik::new_geometry::geometry(std::move(line))); + return std::move(mapnik::geometry::geometry(std::move(line))); } else { @@ -117,7 +117,7 @@ mapnik::new_geometry::geometry shape_io::read_polyline(shape_file::record_type & } int start, end; - mapnik::new_geometry::multi_line_string multi_line; + mapnik::geometry::multi_line_string multi_line; for (int k = 0; k < num_parts; ++k) { start = parts[k]; @@ -130,7 +130,7 @@ mapnik::new_geometry::geometry shape_io::read_polyline(shape_file::record_type & end = parts[k + 1]; } - mapnik::new_geometry::line_string line; + mapnik::geometry::line_string line; line.reserve(end - start); for (int j = start; j < end; ++j) { @@ -140,7 +140,7 @@ mapnik::new_geometry::geometry shape_io::read_polyline(shape_file::record_type & } multi_line.push_back(std::move(line)); } - return std::move(mapnik::new_geometry::geometry(std::move(multi_line))); + return std::move(mapnik::geometry::geometry(std::move(multi_line))); } } @@ -158,7 +158,7 @@ bool is_clockwise(T const& ring) return ( area < 0.0) ? true : false; } -mapnik::new_geometry::geometry shape_io::read_polygon(shape_file::record_type & record) +mapnik::geometry::geometry shape_io::read_polygon(shape_file::record_type & record) { int num_parts = record.read_ndr_integer(); int num_points = record.read_ndr_integer(); @@ -170,15 +170,15 @@ mapnik::new_geometry::geometry shape_io::read_polygon(shape_file::record_type & parts[i] = record.read_ndr_integer(); } - mapnik::new_geometry::multi_polygon multi_poly; - mapnik::new_geometry::polygon poly; + mapnik::geometry::multi_polygon multi_poly; + mapnik::geometry::polygon poly; for (int k = 0; k < num_parts; ++k) { int start = parts[k]; int end; if (k == num_parts - 1) end = num_points; else end = parts[k + 1]; - mapnik::new_geometry::linear_ring ring; + mapnik::geometry::linear_ring ring; ring.reserve(end - start); for (int j = start; j < end; ++j) { @@ -204,7 +204,7 @@ mapnik::new_geometry::geometry shape_io::read_polygon(shape_file::record_type & if (multi_poly.size() > 0) // multi { multi_poly.emplace_back(std::move(poly)); - return std::move(mapnik::new_geometry::geometry(std::move(multi_poly))); + return std::move(mapnik::geometry::geometry(std::move(multi_poly))); } - return std::move(mapnik::new_geometry::geometry(std::move(poly))); + return std::move(mapnik::geometry::geometry(std::move(poly))); } diff --git a/plugins/input/shape/shape_io.hpp b/plugins/input/shape/shape_io.hpp index 7a0d8f2c7..0ba5f12b0 100644 --- a/plugins/input/shape/shape_io.hpp +++ b/plugins/input/shape/shape_io.hpp @@ -76,8 +76,8 @@ public: void move_to(std::streampos pos); static void read_bbox(shape_file::record_type & record, mapnik::box2d & bbox); - static mapnik::new_geometry::geometry read_polyline(shape_file::record_type & record); - static mapnik::new_geometry::geometry read_polygon(shape_file::record_type & record); + static mapnik::geometry::geometry read_polyline(shape_file::record_type & record); + static mapnik::geometry::geometry read_polygon(shape_file::record_type & record); shapeType type_; shape_file shp_; diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index cc9a898b4..d66d3753b 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -448,8 +448,8 @@ boost::optional sqlite_datasource::get_geometry_t if (data) { - mapnik::new_geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, format_); - if (mapnik::new_geometry::empty(geom)) + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, format_); + if (mapnik::geometry::empty(geom)) { continue; } diff --git a/plugins/input/sqlite/sqlite_featureset.cpp b/plugins/input/sqlite/sqlite_featureset.cpp index ac8991625..57d38c914 100644 --- a/plugins/input/sqlite/sqlite_featureset.cpp +++ b/plugins/input/sqlite/sqlite_featureset.cpp @@ -81,8 +81,8 @@ feature_ptr sqlite_featureset::next() } feature_ptr feature = feature_factory::create(ctx_,rs_->column_integer64(1)); - mapnik::new_geometry::geometry geom = geometry_utils::from_wkb(data, size, format_); - if (mapnik::new_geometry::empty(geom)) + mapnik::geometry::geometry geom = geometry_utils::from_wkb(data, size, format_); + if (mapnik::geometry::empty(geom)) { continue; } @@ -90,7 +90,7 @@ feature_ptr sqlite_featureset::next() if (!spatial_index_) { // we are not using r-tree index, check if feature intersects bounding box - box2d bbox = mapnik::new_geometry::envelope(geom); + box2d bbox = mapnik::geometry::envelope(geom); if (!bbox_.intersects(bbox)) continue; } diff --git a/plugins/input/sqlite/sqlite_utils.hpp b/plugins/input/sqlite/sqlite_utils.hpp index dbfb5f2aa..5f9dbef29 100644 --- a/plugins/input/sqlite/sqlite_utils.hpp +++ b/plugins/input/sqlite/sqlite_utils.hpp @@ -196,10 +196,10 @@ public: const char* data = static_cast(rs->column_blob(0, size)); if (data) { - mapnik::new_geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); - if (!mapnik::new_geometry::empty(geom)) + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); + if (!mapnik::geometry::empty(geom)) { - mapnik::box2d bbox = mapnik::new_geometry::envelope(geom); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); if (bbox.valid()) { if (first) @@ -280,10 +280,10 @@ public: const char* data = (const char*) rs->column_blob(0, size); if (data) { - mapnik::new_geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); - if (!mapnik::new_geometry::empty(geom)) + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); + if (!mapnik::geometry::empty(geom)) { - mapnik::box2d bbox = mapnik::new_geometry::envelope(geom); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); if (bbox.valid()) { ps.bind(bbox); @@ -356,10 +356,10 @@ public: const char* data = static_cast(rs->column_blob(0, size)); if (data) { - mapnik::new_geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); - if (!mapnik::new_geometry::empty(geom)) + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb(data, size, mapnik::wkbAuto); + if (!mapnik::geometry::empty(geom)) { - mapnik::box2d bbox = mapnik::new_geometry::envelope(geom); + mapnik::box2d bbox = mapnik::geometry::envelope(geom); if (bbox.valid()) { const int type_oid = rs->column_type(1); diff --git a/plugins/input/templates/helloworld/hello_featureset.cpp b/plugins/input/templates/helloworld/hello_featureset.cpp index 7d2d121b8..0badad361 100644 --- a/plugins/input/templates/helloworld/hello_featureset.cpp +++ b/plugins/input/templates/helloworld/hello_featureset.cpp @@ -35,7 +35,7 @@ mapnik::feature_ptr hello_featureset::next() mapnik::coord2d center = box_.center(); // create a new point geometry - feature->set_geometry(mapnik::new_geometry::point(center.x,center.y)); + feature->set_geometry(mapnik::geometry::point(center.x,center.y)); // return the feature! return feature; @@ -53,7 +53,7 @@ mapnik::feature_ptr hello_featureset::next() // take the outer ring of the bbox that was used to query // to dynamically generate a fake line - mapnik::new_geometry::line_string line; + mapnik::geometry::line_string line; line.reserve(4); line.add_coord(box_.minx(),box_.maxy()); line.add_coord(box_.maxx(),box_.maxy()); diff --git a/plugins/input/topojson/topojson_featureset.cpp b/plugins/input/topojson/topojson_featureset.cpp index c60764b52..7eb88f665 100644 --- a/plugins/input/topojson/topojson_featureset.cpp +++ b/plugins/input/topojson/topojson_featureset.cpp @@ -96,7 +96,7 @@ struct feature_generator x = x * (*topo_.tr).scale_x + (*topo_.tr).translate_x; y = y * (*topo_.tr).scale_y + (*topo_.tr).translate_y; } - mapnik::new_geometry::point point(x, y); + mapnik::geometry::point point(x, y); feature->set_geometry(std::move(point)); assign_properties(*feature, pt, tr_); return feature; @@ -105,7 +105,7 @@ struct feature_generator feature_ptr operator() (multi_point const& multi_pt) const { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - mapnik::new_geometry::multi_point multi_point; + mapnik::geometry::multi_point multi_point; multi_point.reserve(multi_pt.points.size()); for (auto const& pt : multi_pt.points) { @@ -129,7 +129,7 @@ struct feature_generator double px = 0, py = 0; index_type arc_index = line.ring; - mapnik::new_geometry::line_string line_string; + mapnik::geometry::line_string line_string; line_string.reserve( topo_.arcs[arc_index].coordinates.size()); for (auto pt : topo_.arcs[arc_index].coordinates) @@ -152,14 +152,14 @@ struct feature_generator { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); - mapnik::new_geometry::multi_line_string multi_line_string; + mapnik::geometry::multi_line_string multi_line_string; multi_line_string.reserve(multi_line.rings.size()); for (auto const& index : multi_line.rings) { double px = 0, py = 0; bool reverse = index < 0; index_type arc_index = reverse ? std::abs(index) - 1 : index; - mapnik::new_geometry::line_string line_string; + mapnik::geometry::line_string line_string; line_string.reserve(topo_.arcs[arc_index].coordinates.size()); for (auto pt : topo_.arcs[arc_index].coordinates) { @@ -183,12 +183,12 @@ struct feature_generator { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); std::vector processed_coords; - mapnik::new_geometry::polygon polygon; + mapnik::geometry::polygon polygon; if (poly.rings.size() > 1) polygon.interior_rings.reserve(poly.rings.size() - 1); bool first = true; for (auto const& ring : poly.rings) { - mapnik::new_geometry::linear_ring linear_ring; + mapnik::geometry::linear_ring linear_ring; for (auto const& index : ring) { double px = 0, py = 0; @@ -248,18 +248,18 @@ struct feature_generator { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); std::vector processed_coords; - mapnik::new_geometry::multi_polygon multi_polygon; + mapnik::geometry::multi_polygon multi_polygon; multi_polygon.reserve(multi_poly.polygons.size()); for (auto const& poly : multi_poly.polygons) { bool first = true; - mapnik::new_geometry::polygon polygon; + mapnik::geometry::polygon polygon; if (poly.size() > 1) polygon.interior_rings.reserve(poly.size() - 1); for (auto const& ring : poly) { - mapnik::new_geometry::linear_ring linear_ring; + mapnik::geometry::linear_ring linear_ring; for (auto const& index : ring) { double px = 0, py = 0; diff --git a/src/agg/process_debug_symbolizer.cpp b/src/agg/process_debug_symbolizer.cpp index cf5a79a52..7f88cf96f 100644 --- a/src/agg/process_debug_symbolizer.cpp +++ b/src/agg/process_debug_symbolizer.cpp @@ -109,7 +109,7 @@ void agg_renderer::process(debug_symbolizer const& sym, { using apply_vertex_mode = apply_vertex_mode; apply_vertex_mode apply(pixmap_, common_.t_, prj_trans); - util::apply_visitor(new_geometry::vertex_processor(apply), feature.get_geometry()); + util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); } } diff --git a/src/agg/process_dot_symbolizer.cpp b/src/agg/process_dot_symbolizer.cpp index 78c5f9bcb..2c9dd141f 100644 --- a/src/agg/process_dot_symbolizer.cpp +++ b/src/agg/process_dot_symbolizer.cpp @@ -124,7 +124,7 @@ void agg_renderer::process(dot_symbolizer const& sym, ren.color(agg::rgba8_pre(fill.red(), fill.green(), fill.blue(), int(fill.alpha() * opacity))); using render_dot_symbolizer_type = detail::render_dot_symbolizer; render_dot_symbolizer_type apply(rx, ry, *ras_ptr, ren, common_, prj_trans); - mapnik::util::apply_visitor(new_geometry::vertex_processor(apply), feature.get_geometry()); + mapnik::util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); } template void agg_renderer::process(dot_symbolizer const&, diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index b513e982f..41adf387e 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -142,7 +142,7 @@ struct agg_renderer_process_visitor_l if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); } @@ -211,7 +211,7 @@ struct agg_renderer_process_visitor_l if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); } diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index b49042909..aa76f22e1 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -179,7 +179,7 @@ void agg_renderer::process(line_symbolizer const& sym, if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); } @@ -203,7 +203,7 @@ void agg_renderer::process(line_symbolizer const& sym, converter.set(); //always stroke using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index 12fbc52a0..473531d29 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -143,7 +143,7 @@ struct agg_renderer_process_visitor_p double y0 = 0; using apply_local_alignment = detail::apply_local_alignment; apply_local_alignment apply(common_.t_,prj_trans_, clip_box, x0, y0); - util::apply_visitor(new_geometry::vertex_processor(apply), feature_.get_geometry()); + util::apply_visitor(geometry::vertex_processor(apply), feature_.get_geometry()); offset_x = unsigned(current_buffer_->width() - x0); offset_y = unsigned(current_buffer_->height() - y0); } @@ -173,7 +173,7 @@ struct agg_renderer_process_visitor_p if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); agg::scanline_u8 sl; @@ -243,7 +243,7 @@ struct agg_renderer_process_visitor_p double y0 = 0; using apply_local_alignment = detail::apply_local_alignment; apply_local_alignment apply(common_.t_,prj_trans_, clip_box, x0, y0); - util::apply_visitor(new_geometry::vertex_processor(apply), feature_.get_geometry()); + util::apply_visitor(geometry::vertex_processor(apply), feature_.get_geometry()); offset_x = unsigned(current_buffer_->width() - x0); offset_y = unsigned(current_buffer_->height() - y0); @@ -273,7 +273,7 @@ struct agg_renderer_process_visitor_p if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); agg::scanline_u8 sl; diff --git a/src/cairo/process_debug_symbolizer.cpp b/src/cairo/process_debug_symbolizer.cpp index 2ea7428ca..ff84dc8e8 100644 --- a/src/cairo/process_debug_symbolizer.cpp +++ b/src/cairo/process_debug_symbolizer.cpp @@ -117,7 +117,7 @@ void cairo_renderer::process(debug_symbolizer const& sym, { using apply_vertex_mode = apply_vertex_mode; apply_vertex_mode apply(context_, common_.t_, prj_trans); - util::apply_visitor(new_geometry::vertex_processor(apply), feature.get_geometry()); + util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); } } diff --git a/src/cairo/process_line_pattern_symbolizer.cpp b/src/cairo/process_line_pattern_symbolizer.cpp index b3d0274bd..3ab203f08 100644 --- a/src/cairo/process_line_pattern_symbolizer.cpp +++ b/src/cairo/process_line_pattern_symbolizer.cpp @@ -159,7 +159,7 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply), feature.get_geometry()); } diff --git a/src/cairo/process_line_symbolizer.cpp b/src/cairo/process_line_symbolizer.cpp index b37fb301e..70bc0c7f4 100644 --- a/src/cairo/process_line_symbolizer.cpp +++ b/src/cairo/process_line_symbolizer.cpp @@ -99,7 +99,7 @@ void cairo_renderer::process(line_symbolizer const& sym, if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // stroke diff --git a/src/cairo/process_polygon_pattern_symbolizer.cpp b/src/cairo/process_polygon_pattern_symbolizer.cpp index 7dbba48b4..523eb0e09 100644 --- a/src/cairo/process_polygon_pattern_symbolizer.cpp +++ b/src/cairo/process_polygon_pattern_symbolizer.cpp @@ -114,7 +114,7 @@ void cairo_renderer::process(polygon_pattern_symbolizer const& sym, double y0 = 0.0; using apply_local_alignment = detail::apply_local_alignment; apply_local_alignment apply(common_.t_, prj_trans, clip_box, x0, y0); - util::apply_visitor(new_geometry::vertex_processor(apply), feature.get_geometry()); + util::apply_visitor(geometry::vertex_processor(apply), feature.get_geometry()); offset_x = std::abs(clip_box.width() - x0); offset_y = std::abs(clip_box.height() - y0); } @@ -139,7 +139,7 @@ void cairo_renderer::process(polygon_pattern_symbolizer const& sym, if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // fill polygon diff --git a/src/grid/process_line_pattern_symbolizer.cpp b/src/grid/process_line_pattern_symbolizer.cpp index bbe1d228b..12bb9ba3c 100644 --- a/src/grid/process_line_pattern_symbolizer.cpp +++ b/src/grid/process_line_pattern_symbolizer.cpp @@ -128,7 +128,7 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, if (smooth > 0.0) converter.set(); // optional smooth converter converter.set(); //always stroke using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index a8e04c850..81f2880a4 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -104,7 +104,7 @@ void grid_renderer::process(line_symbolizer const& sym, converter.set(); //always stroke using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); diff --git a/src/grid/process_polygon_pattern_symbolizer.cpp b/src/grid/process_polygon_pattern_symbolizer.cpp index 24a71ff33..f153674a8 100644 --- a/src/grid/process_polygon_pattern_symbolizer.cpp +++ b/src/grid/process_polygon_pattern_symbolizer.cpp @@ -86,7 +86,7 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, if (smooth > 0.0) converter.set(); // optional smooth converter using apply_vertex_converter_type = detail::apply_vertex_converter; - using vertex_processor_type = new_geometry::vertex_processor; + using vertex_processor_type = geometry::vertex_processor; apply_vertex_converter_type apply(converter); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); diff --git a/src/group/group_symbolizer_helper.cpp b/src/group/group_symbolizer_helper.cpp index 8c0ae23c7..b874e3921 100644 --- a/src/group/group_symbolizer_helper.cpp +++ b/src/group/group_symbolizer_helper.cpp @@ -92,7 +92,7 @@ pixel_position_list const& group_symbolizer_helper::get() // TODO to support clipped geometries this needs to use // vertex_converters apply_find_line_placements apply(t_, prj_trans_, *this); - mapnik::util::apply_visitor(new_geometry::vertex_processor(apply), *geom); + mapnik::util::apply_visitor(geometry::vertex_processor(apply), *geom); } } diff --git a/src/json/mapnik_json_generator_grammar.cpp b/src/json/mapnik_json_generator_grammar.cpp index f422e5962..9473d30e7 100644 --- a/src/json/mapnik_json_generator_grammar.cpp +++ b/src/json/mapnik_json_generator_grammar.cpp @@ -32,4 +32,4 @@ using sink_type = std::back_insert_iterator; template struct mapnik::json::properties_generator_grammar; template struct mapnik::json::feature_generator_grammar; -template struct mapnik::json::geometry_generator_grammar; +template struct mapnik::json::geometry_generator_grammar; diff --git a/src/text/symbolizer_helpers.cpp b/src/text/symbolizer_helpers.cpp index c4e527fc2..7b31b6e15 100644 --- a/src/text/symbolizer_helpers.cpp +++ b/src/text/symbolizer_helpers.cpp @@ -102,10 +102,10 @@ base_symbolizer_helper::base_symbolizer_helper( struct largest_bbox_first { - bool operator() (new_geometry::geometry const* g0, new_geometry::geometry const* g1) const + bool operator() (geometry::geometry const* g0, geometry::geometry const* g1) const { - box2d b0 = new_geometry::envelope(*g0); - box2d b1 = new_geometry::envelope(*g1); + box2d b0 = geometry::envelope(*g0); + box2d b1 = geometry::envelope(*g1); return b0.width() * b0.height() > b1.width() * b1.height(); } }; @@ -115,27 +115,27 @@ void base_symbolizer_helper::initialize_geometries() const bool largest_box_only = text_props_->largest_bbox_only; double minimum_path_length = text_props_->minimum_path_length; - new_geometry::geometry const& geom = feature_.get_geometry(); - new_geometry::geometry_types type = new_geometry::geometry_type(geom); + geometry::geometry const& geom = feature_.get_geometry(); + geometry::geometry_types type = geometry::geometry_type(geom); // FIXME: how to handle MultiLinePolygon - if (type == new_geometry::geometry_types::Polygon) + if (type == geometry::geometry_types::Polygon) { if (minimum_path_length > 0) { - box2d gbox = t_.forward(new_geometry::envelope(geom), prj_trans_); + box2d gbox = t_.forward(geometry::envelope(geom), prj_trans_); if (gbox.width() >= minimum_path_length) { - geometries_to_process_.push_back(const_cast(&geom)); + geometries_to_process_.push_back(const_cast(&geom)); } } else { - geometries_to_process_.push_back(const_cast(&geom)); + geometries_to_process_.push_back(const_cast(&geom)); } } else { - geometries_to_process_.push_back(const_cast(&geom)); + geometries_to_process_.push_back(const_cast(&geom)); } // FIXME: return early if geometries_to_process_.empty() ? if (largest_box_only) @@ -166,12 +166,12 @@ void base_symbolizer_helper::initialize_points() const for (auto * geom_ptr : geometries_to_process_) { - new_geometry::geometry const& geom = *geom_ptr; + geometry::geometry const& geom = *geom_ptr; if (how_placed == VERTEX_PLACEMENT) { using apply_vertex_placement = detail::apply_vertex_placement >; apply_vertex_placement apply(points_, t_, prj_trans_); - util::apply_visitor(new_geometry::vertex_processor(apply), geom); + util::apply_visitor(geometry::vertex_processor(apply), geom); #if 0 va.rewind(0); for(unsigned i = 0; i < va.size(); ++i) @@ -188,19 +188,19 @@ void base_symbolizer_helper::initialize_points() const // https://github.com/mapnik/mapnik/issues/1423 bool success = false; // https://github.com/mapnik/mapnik/issues/1350 - auto type = new_geometry::geometry_type(geom); + auto type = geometry::geometry_type(geom); // FIXME: how to handle MultiLineString? - if (type == new_geometry::geometry_types::LineString) + if (type == geometry::geometry_types::LineString) { - auto const& line = mapnik::util::get(geom); - new_geometry::line_string_vertex_adapter va(line); + auto const& line = mapnik::util::get(geom); + geometry::line_string_vertex_adapter va(line); success = label::middle_point(va, label_x,label_y); } else if (how_placed == POINT_PLACEMENT) { - new_geometry::point pt; - new_geometry::centroid(geom, pt); + geometry::point pt; + geometry::centroid(geom, pt); label_x = pt.x; label_y = pt.y; success = true; @@ -282,11 +282,11 @@ bool text_symbolizer_helper::next_line_placement() const continue; //Reexecute size check } - auto type = new_geometry::geometry_type(**geo_itr_); - if (type == new_geometry::LineString) // ?? + auto type = geometry::geometry_type(**geo_itr_); + if (type == geometry::LineString) // ?? { - auto const& line = util::get(**geo_itr_); - new_geometry::line_string_vertex_adapter va(line); + auto const& line = util::get(**geo_itr_); + geometry::line_string_vertex_adapter va(line); converter_.apply(va); if (adapter_.status()) { diff --git a/src/wkb.cpp b/src/wkb.cpp index fa31bfa46..e1580d4b3 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -119,59 +119,59 @@ public: needSwap_ = byteOrder_ ? wkbXDR : wkbNDR; } - mapnik::new_geometry::geometry read() + mapnik::geometry::geometry read() { int type = read_integer(); switch (type) { case wkbPoint: - return std::move(mapnik::new_geometry::geometry(read_point())); + return std::move(mapnik::geometry::geometry(read_point())); case wkbLineString: - return std::move(mapnik::new_geometry::geometry(read_linestring())); + return std::move(mapnik::geometry::geometry(read_linestring())); case wkbPolygon: - return std::move(mapnik::new_geometry::geometry(read_polygon())); + return std::move(mapnik::geometry::geometry(read_polygon())); case wkbMultiPoint: - return std::move(mapnik::new_geometry::geometry(read_multipoint())); + return std::move(mapnik::geometry::geometry(read_multipoint())); case wkbMultiLineString: - return std::move(mapnik::new_geometry::geometry(read_multilinestring())); + return std::move(mapnik::geometry::geometry(read_multilinestring())); case wkbMultiPolygon: - return std::move(mapnik::new_geometry::geometry(read_multipolygon())); + return std::move(mapnik::geometry::geometry(read_multipolygon())); case wkbGeometryCollection: - return std::move(mapnik::new_geometry::geometry(read_collection())); + return std::move(mapnik::geometry::geometry(read_collection())); case wkbPointZ: case wkbPointM: - return std::move(mapnik::new_geometry::geometry(read_point())); + return std::move(mapnik::geometry::geometry(read_point())); case wkbPointZM: - return std::move(mapnik::new_geometry::geometry(read_point())); + return std::move(mapnik::geometry::geometry(read_point())); case wkbLineStringZ: case wkbLineStringM: - return std::move(mapnik::new_geometry::geometry(read_linestring())); + return std::move(mapnik::geometry::geometry(read_linestring())); case wkbLineStringZM: - return std::move(mapnik::new_geometry::geometry(read_linestring())); + return std::move(mapnik::geometry::geometry(read_linestring())); case wkbPolygonZ: case wkbPolygonM: - return std::move(mapnik::new_geometry::geometry(read_polygon())); + return std::move(mapnik::geometry::geometry(read_polygon())); case wkbPolygonZM: - return std::move(mapnik::new_geometry::geometry(read_polygon())); + return std::move(mapnik::geometry::geometry(read_polygon())); case wkbMultiPointZ: case wkbMultiPointM: - return std::move(mapnik::new_geometry::geometry(read_multipoint())); + return std::move(mapnik::geometry::geometry(read_multipoint())); case wkbMultiPointZM: - return std::move(mapnik::new_geometry::geometry(read_multipoint())); + return std::move(mapnik::geometry::geometry(read_multipoint())); case wkbMultiLineStringZ: case wkbMultiLineStringM: - return std::move(mapnik::new_geometry::geometry(read_multilinestring())); + return std::move(mapnik::geometry::geometry(read_multilinestring())); case wkbMultiLineStringZM: - return std::move(mapnik::new_geometry::geometry(read_multilinestring())); + return std::move(mapnik::geometry::geometry(read_multilinestring())); case wkbMultiPolygonZ: case wkbMultiPolygonM: - return std::move(mapnik::new_geometry::geometry(read_multipolygon())); + return std::move(mapnik::geometry::geometry(read_multipolygon())); case wkbMultiPolygonZM: - return std::move(mapnik::new_geometry::geometry(read_multipolygon())); + return std::move(mapnik::geometry::geometry(read_multipolygon())); case wkbGeometryCollectionZ: case wkbGeometryCollectionM: case wkbGeometryCollectionZM: - return std::move(mapnik::new_geometry::geometry(read_collection())); + return std::move(mapnik::geometry::geometry(read_collection())); default: break; } @@ -243,19 +243,19 @@ private: } template - mapnik::new_geometry::point read_point() + mapnik::geometry::point read_point() { double x = read_double(); double y = read_double(); if (Z) pos_ += 8; if (M) pos_ += 8; - return mapnik::new_geometry::point(x, y); + return mapnik::geometry::point(x, y); } template - mapnik::new_geometry::multi_point read_multipoint() + mapnik::geometry::multi_point read_multipoint() { - mapnik::new_geometry::multi_point multi_point; + mapnik::geometry::multi_point multi_point; int num_points = read_integer(); multi_point.reserve(num_points); for (int i = 0; i < num_points; ++i) @@ -267,23 +267,23 @@ private: } template - mapnik::new_geometry::line_string read_linestring() + mapnik::geometry::line_string read_linestring() { - mapnik::new_geometry::line_string line; + mapnik::geometry::line_string line; int num_points = read_integer(); if (num_points > 0) { line.reserve(num_points); - read_coords(line, num_points); + read_coords(line, num_points); } return line; } template - mapnik::new_geometry::multi_line_string read_multilinestring() + mapnik::geometry::multi_line_string read_multilinestring() { int num_lines = read_integer(); - mapnik::new_geometry::multi_line_string multi_line; + mapnik::geometry::multi_line_string multi_line; multi_line.reserve(num_lines); for (int i = 0; i < num_lines; ++i) { @@ -294,10 +294,10 @@ private: } template - mapnik::new_geometry::polygon read_polygon() + mapnik::geometry::polygon read_polygon() { int num_rings = read_integer(); - mapnik::new_geometry::polygon poly; + mapnik::geometry::polygon poly; if (num_rings > 1) { poly.interior_rings.reserve(num_rings - 1); @@ -305,12 +305,12 @@ private: for (int i = 0; i < num_rings; ++i) { - mapnik::new_geometry::linear_ring ring; + mapnik::geometry::linear_ring ring; int num_points = read_integer(); if (num_points > 0) { ring.reserve(num_points); - read_coords(ring, num_points); + read_coords(ring, num_points); } if ( i == 0) poly.set_exterior_ring(std::move(ring)); else poly.add_hole(std::move(ring)); @@ -321,10 +321,10 @@ private: } template - mapnik::new_geometry::multi_polygon read_multipolygon() + mapnik::geometry::multi_polygon read_multipolygon() { int num_polys = read_integer(); - mapnik::new_geometry::multi_polygon multi_poly; + mapnik::geometry::multi_polygon multi_poly; for (int i = 0; i < num_polys; ++i) { pos_ += 5; @@ -333,10 +333,10 @@ private: return multi_poly; } - mapnik::new_geometry::geometry_collection read_collection() + mapnik::geometry::geometry_collection read_collection() { int num_geometries = read_integer(); - mapnik::new_geometry::geometry_collection collection; + mapnik::geometry::geometry_collection collection; for (int i = 0; i < num_geometries; ++i) { pos_ += 1; // skip byte order @@ -387,12 +387,12 @@ private: }; -mapnik::new_geometry::geometry geometry_utils::from_wkb(const char* wkb, +mapnik::geometry::geometry geometry_utils::from_wkb(const char* wkb, unsigned size, wkbFormat format) { wkb_reader reader(wkb, size, format); - return mapnik::new_geometry::geometry(reader.read()); + return mapnik::geometry::geometry(reader.read()); } } // namespace mapnik diff --git a/src/wkt/mapnik_wkt_generator_grammar.cpp b/src/wkt/mapnik_wkt_generator_grammar.cpp index 37a5b4cbe..05fa6610b 100644 --- a/src/wkt/mapnik_wkt_generator_grammar.cpp +++ b/src/wkt/mapnik_wkt_generator_grammar.cpp @@ -27,6 +27,6 @@ namespace mapnik { namespace wkt { using sink_type = std::back_insert_iterator; -template struct wkt_generator_grammar; +template struct wkt_generator_grammar; }} diff --git a/tests/cpp_tests/fontset_runtime_test.cpp b/tests/cpp_tests/fontset_runtime_test.cpp index 07b31dc73..357dd2ab2 100644 --- a/tests/cpp_tests/fontset_runtime_test.cpp +++ b/tests/cpp_tests/fontset_runtime_test.cpp @@ -48,9 +48,9 @@ int main(int argc, char** argv) mapnik::transcoder tr("utf-8"); mapnik::value_unicode_string ustr = tr.transcode("hello world!"); feature->put("name",ustr); - //auto pt = std::make_unique(mapnik::new_geometry::geometry_types::Point); + //auto pt = std::make_unique(mapnik::geometry::geometry_types::Point); //pt->move_to(128,128); - mapnik::new_geometry::point pt(128,128); + mapnik::geometry::point pt(128,128); feature->set_geometry(std::move(pt)); mapnik::parameters params; diff --git a/tests/cpp_tests/geometry_converters_test.cpp b/tests/cpp_tests/geometry_converters_test.cpp index 867ff2af5..1932ea0d7 100644 --- a/tests/cpp_tests/geometry_converters_test.cpp +++ b/tests/cpp_tests/geometry_converters_test.cpp @@ -55,7 +55,7 @@ boost::optional linestring_bbox_clipping(mapnik::box2d bbox line_symbolizer sym; view_transform t(bbox.width(),bbox.height(), bbox); mapnik::geometry_container output_paths; - output_geometry_backend backend(output_paths, mapnik::new_geometry::geometry_types::LineString); + output_geometry_backend backend(output_paths, mapnik::geometry::geometry_types::LineString); mapnik::context_ptr ctx = std::make_shared(); mapnik::feature_impl f(ctx,0); @@ -98,7 +98,7 @@ boost::optional polygon_bbox_clipping(mapnik::box2d bbox, polygon_symbolizer sym; view_transform t(bbox.width(),bbox.height(), bbox); mapnik::geometry_container output_paths; - output_geometry_backend backend(output_paths, mapnik::new_geometry::geometry_types::Polygon); + output_geometry_backend backend(output_paths, mapnik::geometry::geometry_types::Polygon); mapnik::context_ptr ctx = std::make_shared(); mapnik::feature_impl f(ctx,0); diff --git a/tests/cpp_tests/label_algo_test.cpp b/tests/cpp_tests/label_algo_test.cpp index a0b0768e5..49a669b91 100644 --- a/tests/cpp_tests/label_algo_test.cpp +++ b/tests/cpp_tests/label_algo_test.cpp @@ -18,22 +18,22 @@ int main(int argc, char** argv) try { // reused these for simplicity - mapnik::new_geometry::point centroid; + mapnik::geometry::point centroid; { // single point - mapnik::new_geometry::point pt(10,10); - BOOST_TEST( mapnik::new_geometry::centroid(pt, centroid)); + mapnik::geometry::point pt(10,10); + BOOST_TEST( mapnik::geometry::centroid(pt, centroid)); BOOST_TEST( pt.x == centroid.x); BOOST_TEST( pt.y == centroid.y); } // linestring with three consecutive verticies { - mapnik::new_geometry::line_string line; + mapnik::geometry::line_string line; line.add_coord(0, 0); line.add_coord(25, 25); line.add_coord(50, 50); - BOOST_TEST(mapnik::new_geometry::centroid(line, centroid)); + BOOST_TEST(mapnik::geometry::centroid(line, centroid)); BOOST_TEST( centroid.x == 25 ); BOOST_TEST( centroid.y == 25 ); } @@ -42,7 +42,7 @@ int main(int argc, char** argv) #if 0 // hit tests { - mapnik::geometry_type pt_hit(mapnik::new_geometry::geometry_types::Point); + mapnik::geometry_type pt_hit(mapnik::geometry::geometry_types::Point); pt_hit.move_to(10,10); mapnik::vertex_adapter va(pt_hit); BOOST_TEST( mapnik::label::hit_test(va, 10, 10, 0.1) ); @@ -50,7 +50,7 @@ int main(int argc, char** argv) BOOST_TEST( mapnik::label::hit_test(va, 9, 9, 1.5) ); } { - mapnik::geometry_type line_hit(mapnik::new_geometry::geometry_types::LineString); + mapnik::geometry_type line_hit(mapnik::geometry::geometry_types::LineString); line_hit.move_to(0,0); line_hit.line_to(50,50); mapnik::vertex_adapter va(line_hit); diff --git a/tests/cpp_tests/wkb_formats_test.cpp b/tests/cpp_tests/wkb_formats_test.cpp index 678613c08..5ba4f0667 100644 --- a/tests/cpp_tests/wkb_formats_test.cpp +++ b/tests/cpp_tests/wkb_formats_test.cpp @@ -68,15 +68,15 @@ int main(int argc, char** argv) try { // spatialite blob - mapnik::new_geometry::geometry geom = mapnik::geometry_utils::from_wkb((const char*)sp_valid_blob, + mapnik::geometry::geometry geom = mapnik::geometry_utils::from_wkb((const char*)sp_valid_blob, sizeof(sp_valid_blob) / sizeof(sp_valid_blob[0]), mapnik::wkbSpatiaLite); - BOOST_TEST(mapnik::new_geometry::is_valid(geom) && mapnik::new_geometry::is_simple(geom)); + BOOST_TEST(mapnik::geometry::is_valid(geom) && mapnik::geometry::is_simple(geom)); geom = mapnik::geometry_utils::from_wkb((const char*)sp_valid_blob, sizeof(sp_valid_blob) / sizeof(sp_valid_blob[0]), mapnik::wkbAuto); - BOOST_TEST(mapnik::new_geometry::is_valid(geom) && mapnik::new_geometry::is_simple(geom)); + BOOST_TEST(mapnik::geometry::is_valid(geom) && mapnik::geometry::is_simple(geom)); @@ -88,13 +88,13 @@ int main(int argc, char** argv) geom = mapnik::geometry_utils::from_wkb((const char*)sq_valid_blob, sizeof(sq_valid_blob) / sizeof(sq_valid_blob[0]), mapnik::wkbGeneric); - BOOST_TEST(mapnik::new_geometry::is_valid(geom) && mapnik::new_geometry::is_simple(geom)); + BOOST_TEST(mapnik::geometry::is_valid(geom) && mapnik::geometry::is_simple(geom)); geom = mapnik::geometry_utils::from_wkb( (const char*)sq_valid_blob, sizeof(sq_valid_blob) / sizeof(sq_valid_blob[0]), mapnik::wkbAuto); - BOOST_TEST(mapnik::new_geometry::is_valid(geom) && mapnik::new_geometry::is_simple(geom)); + BOOST_TEST(mapnik::geometry::is_valid(geom) && mapnik::geometry::is_simple(geom)); BOOST_TEST_THROWS(mapnik::geometry_utils::from_wkb((const char*)sq_invalid_blob, sizeof(sq_invalid_blob) / sizeof(sq_invalid_blob[0]), diff --git a/tests/cxx/datasources.cpp b/tests/cxx/datasources.cpp index 7e07348ed..2a34f0905 100644 --- a/tests/cxx/datasources.cpp +++ b/tests/cxx/datasources.cpp @@ -1,4 +1,3 @@ - #include "catch.hpp" #include @@ -30,13 +29,13 @@ SECTION("hello world") { REQUIRE( feat1->id() == static_cast(1) ); REQUIRE( feat2->id() == static_cast(2) ); auto const& geom1 = feat1->get_geometry(); - REQUIRE( geom1.is() ); - auto const& point = mapnik::util::get(geom1); + REQUIRE( geom1.is() ); + auto const& point = mapnik::util::get(geom1); REQUIRE( point.x == bbox.center().x ); REQUIRE( point.y == bbox.center().y ); auto const& geom2 = feat2->get_geometry(); - REQUIRE( geom2.is() ); - auto const& line = mapnik::util::get(geom2); + REQUIRE( geom2.is() ); + auto const& line = mapnik::util::get(geom2); REQUIRE( line.size() == 4 ); REQUIRE( line[0].x == bbox.minx() ); REQUIRE( line[0].y == bbox.maxy() ); diff --git a/tests/cxx/geometry.cpp b/tests/cxx/geometry.cpp index 263fa8d16..7b329152b 100644 --- a/tests/cxx/geometry.cpp +++ b/tests/cxx/geometry.cpp @@ -11,11 +11,11 @@ TEST_CASE("geometry") { SECTION("json point") { mapnik::util::file input("./tests/data/json/fixtures/point1.json"); auto json = input.data(); - mapnik::new_geometry::geometry geom; + mapnik::geometry::geometry geom; std::string json_string(json.get()); REQUIRE( mapnik::json::from_geojson(json_string, geom) ); - REQUIRE( geom.is() ); - auto const& point = mapnik::util::get(geom); + REQUIRE( geom.is() ); + auto const& point = mapnik::util::get(geom); REQUIRE( point.x == 30 ); REQUIRE( point.y == 10 ); std::string new_json; @@ -25,11 +25,11 @@ SECTION("json point") { SECTION("json point reversed") { mapnik::util::file input("./tests/data/json/fixtures/point2.json"); auto json = input.data(); - mapnik::new_geometry::geometry geom; + mapnik::geometry::geometry geom; std::string json_string(json.get()); REQUIRE( mapnik::json::from_geojson(json_string,geom) ); - REQUIRE( geom.is() ); - auto const& point = mapnik::util::get(geom); + REQUIRE( geom.is() ); + auto const& point = mapnik::util::get(geom); REQUIRE( point.x == 30 ); REQUIRE( point.y == 10 ); } diff --git a/tests/cxx/geometry_hit_test.cpp b/tests/cxx/geometry_hit_test.cpp index e7be68cbe..ad9538165 100644 --- a/tests/cxx/geometry_hit_test.cpp +++ b/tests/cxx/geometry_hit_test.cpp @@ -7,7 +7,7 @@ TEST_CASE("geometry ops") { SECTION("hit_test_filter") { - using namespace mapnik::new_geometry; + using namespace mapnik::geometry; { geometry geom(point(0,0)); REQUIRE( mapnik::hit_test(geom,0,0,0) ); diff --git a/utils/geometry_to_wkb/main.cpp b/utils/geometry_to_wkb/main.cpp index 877c1db0a..248fda262 100644 --- a/utils/geometry_to_wkb/main.cpp +++ b/utils/geometry_to_wkb/main.cpp @@ -81,7 +81,7 @@ int main (int argc, char ** argv ) while(f) { std::cerr << *f << std::endl; - mapnik::new_geometry::geometry const& geom = f->get_geometry(); + mapnik::geometry::geometry const& geom = f->get_geometry(); // NDR { mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::wkbNDR); diff --git a/utils/pgsql2sqlite/pgsql2sqlite.hpp b/utils/pgsql2sqlite/pgsql2sqlite.hpp index 73d5c439f..81e8cbb30 100644 --- a/utils/pgsql2sqlite/pgsql2sqlite.hpp +++ b/utils/pgsql2sqlite/pgsql2sqlite.hpp @@ -389,10 +389,10 @@ void pgsql2sqlite(Connection conn, if (oid == geometry_oid) { mapnik::Feature feat(ctx,pkid); - mapnik::new_geometry::geometry geom = geometry_utils::from_wkb(buf, size, wkbGeneric); - if (!mapnik::new_geometry::empty(geom)) + mapnik::geometry::geometry geom = geometry_utils::from_wkb(buf, size, wkbGeneric); + if (!mapnik::geometry::empty(geom)) { - box2d bbox = mapnik::new_geometry::envelope(geom); + box2d bbox = mapnik::geometry::envelope(geom); if (bbox.valid()) { sqlite::record_type rec;