From dac71706162a79ab5ac1d02cdf5bc0e43f1e621e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 15 Oct 2014 18:59:39 -0700 Subject: [PATCH] break out topojson parsing grammar --- plugins/input/topojson/build.py | 4 +-- .../input/topojson/topojson_datasource.cpp | 1 - src/json/mapnik_topojson_grammar.cpp | 28 +++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 src/json/mapnik_topojson_grammar.cpp diff --git a/plugins/input/topojson/build.py b/plugins/input/topojson/build.py index e131e1087..4299b8933 100644 --- a/plugins/input/topojson/build.py +++ b/plugins/input/topojson/build.py @@ -38,8 +38,7 @@ plugin_sources = Split( libraries = [] libraries.append(env['ICU_LIB_NAME']) libraries.append('boost_system%s' % env['BOOST_APPEND']) -#if env['THREADING'] == 'multi': -# libraries.append('boost_thread%s' % env['BOOST_APPEND']) +libraries.append('mapnik_topojson_grammar') if env['PLUGIN_LINKING'] == 'shared': libraries.append(env['MAPNIK_NAME']) @@ -52,6 +51,7 @@ if env['PLUGIN_LINKING'] == 'shared': # if the plugin links to libmapnik ensure it is built first Depends(TARGET, env.subst('../../../src/%s' % env['MAPNIK_LIB_NAME'])) + Depends(TARGET, env.subst('../../../src/json/libmapnik_topojson_grammar${LIBSUFFIX}')) if 'uninstall' not in COMMAND_LINE_TARGETS: env.Install(env['MAPNIK_INPUT_PLUGINS_DEST'], TARGET) diff --git a/plugins/input/topojson/topojson_datasource.cpp b/plugins/input/topojson/topojson_datasource.cpp index 341390902..1109d4f9c 100644 --- a/plugins/input/topojson/topojson_datasource.cpp +++ b/plugins/input/topojson/topojson_datasource.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/src/json/mapnik_topojson_grammar.cpp b/src/json/mapnik_topojson_grammar.cpp new file mode 100644 index 000000000..6f232abf3 --- /dev/null +++ b/src/json/mapnik_topojson_grammar.cpp @@ -0,0 +1,28 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + +#include +#include +#include + +using iterator_type = std::string::const_iterator; +template struct mapnik::topojson::topojson_grammar ;