From 642bdfa78c399e291ccc64d6851defa4b171a35d Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 16 Mar 2015 16:14:54 +0100 Subject: [PATCH] fix geometry_to_wkb utility --- utils/geometry_to_wkb/Jamroot | 12 ++++++------ utils/geometry_to_wkb/main.cpp | 28 ++++++++++++---------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/utils/geometry_to_wkb/Jamroot b/utils/geometry_to_wkb/Jamroot index 92c6686a7..edb1527ae 100644 --- a/utils/geometry_to_wkb/Jamroot +++ b/utils/geometry_to_wkb/Jamroot @@ -1,12 +1,12 @@ ###################################################################### -MAPNIK_INCLUDE_DIR = "/opt/mapnik/include" ; +MAPNIK_INCLUDE_DIR = "/Users/artem/Projects/mapnik/include" ; MAPNIK_LIB_DIR = "/opt/mapnik/lib" ; -BOOST_INCLUDE_DIR = "/opt/boost_1_48_0/include" ; - +BOOST_INCLUDE_DIR = "/opt/boost/include" ; +ICU_DIR = "/opt/icu" ; lib mapnik : : mapnik $(MAPNIK_LIB_DIR) ; -lib icu : : icuuc /usr/local/lib ; +lib icu : : icuuc $(ICU_DIR)/lib ; exe to_wkb : main.cpp @@ -14,6 +14,6 @@ exe to_wkb : .//icu : $(MAPNIK_INCLUDE_DIR) - $(BOOST_INCLUDE_DIR) + $(BOOST_INCLUDE_DIR) + $(ICU_DIR)/include ; - diff --git a/utils/geometry_to_wkb/main.cpp b/utils/geometry_to_wkb/main.cpp index 0ab4875bc..3ac1f6b4b 100644 --- a/utils/geometry_to_wkb/main.cpp +++ b/utils/geometry_to_wkb/main.cpp @@ -24,14 +24,14 @@ #include #include -#include +#include #include +#include +#include #include #include - - int main (int argc, char ** argv ) { @@ -81,21 +81,17 @@ int main (int argc, char ** argv ) while(f) { std::cerr << *f << std::endl; - mapnik::geometry_container const& paths = f->paths(); - for (mapnik::geometry_type const& geom : paths) + mapnik::new_geometry::geometry const& geom = f->get_geometry(); + // NDR { - // NDR - { - mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::util::wkbNDR); - std::cerr << mapnik::util::to_hex(wkb->buffer(),wkb->size()) << std::endl; - } - // XDR - { - mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::util::wkbXDR); - std::cerr << mapnik::util::to_hex(wkb->buffer(),wkb->size()) << std::endl; - } + mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::wkbNDR); + std::cerr << mapnik::util::detail::to_hex(wkb->buffer(),wkb->size()) << std::endl; + } + // XDR + { + mapnik::util::wkb_buffer_ptr wkb = mapnik::util::to_wkb(geom,mapnik::wkbXDR); + std::cerr << mapnik::util::detail::to_hex(wkb->buffer(),wkb->size()) << std::endl; } - f = fs->next(); } }