Skip to content

Commit a063df4

Browse files
author
Dane Springmeyer
committed
remove dead code
1 parent b223124 commit a063df4

File tree

2 files changed

+2
-72
lines changed

2 files changed

+2
-72
lines changed

src/python_grid_utils.cpp

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include <mapnik/debug.hpp>
4343
#include <mapnik/grid/grid_renderer.hpp>
4444
#include <mapnik/grid/grid.hpp>
45-
#include <mapnik/grid/grid_util.hpp>
4645
#include <mapnik/grid/grid_view.hpp>
4746
#include <mapnik/value_error.hpp>
4847
#include <mapnik/feature.hpp>
@@ -180,65 +179,6 @@ void grid2utf(T const& grid_type,
180179
}
181180
}
182181

183-
184-
template <typename T>
185-
void grid2utf2(T const& grid_type,
186-
boost::python::list& l,
187-
std::vector<typename T::lookup_type>& key_order,
188-
unsigned int resolution)
189-
{
190-
using keys_type = std::map< typename T::lookup_type, typename T::value_type>;
191-
using keys_iterator = typename keys_type::iterator;
192-
193-
typename T::data_type const& data = grid_type.data();
194-
typename T::feature_key_type const& feature_keys = grid_type.get_feature_keys();
195-
typename T::feature_key_type::const_iterator feature_pos;
196-
197-
keys_type keys;
198-
// start counting at utf8 codepoint 32, aka space character
199-
uint16_t codepoint = 32;
200-
201-
mapnik::grid::data_type target(data.width()/resolution,data.height()/resolution);
202-
mapnik::scale_grid(target,grid_type.data(),0.0,0.0);
203-
204-
std::size_t array_size = target.width();
205-
for (std::size_t y = 0; y < target.height(); ++y)
206-
{
207-
uint16_t idx = 0;
208-
const std::unique_ptr<Py_UNICODE[]> line(new Py_UNICODE[array_size]);
209-
mapnik::grid::value_type * row = target.get_row(y);
210-
for (std::size_t x = 0; x < target.width(); ++x)
211-
{
212-
feature_pos = feature_keys.find(row[x]);
213-
if (feature_pos != feature_keys.end())
214-
{
215-
mapnik::grid::lookup_type val = feature_pos->second;
216-
keys_iterator key_pos = keys.find(val);
217-
if (key_pos == keys.end())
218-
{
219-
// Create a new entry for this key. Skip the codepoints that
220-
// can't be encoded directly in JSON.
221-
if (codepoint == 34) ++codepoint; // Skip "
222-
else if (codepoint == 92) ++codepoint; // Skip backslash
223-
keys[val] = codepoint;
224-
key_order.push_back(val);
225-
line[idx++] = static_cast<Py_UNICODE>(codepoint);
226-
++codepoint;
227-
}
228-
else
229-
{
230-
line[idx++] = static_cast<Py_UNICODE>(key_pos->second);
231-
}
232-
}
233-
// else, shouldn't get here...
234-
}
235-
l.append(boost::python::object(
236-
boost::python::handle<>(
237-
PyUnicode_FromUnicode(line.get(), array_size))));
238-
}
239-
}
240-
241-
242182
template <typename T>
243183
void write_features(T const& grid_type,
244184
boost::python::dict& feature_data,
@@ -298,12 +238,9 @@ void grid_encode_utf(T const& grid_type,
298238
boost::python::list l;
299239
std::vector<typename T::lookup_type> key_order;
300240

301-
if (resolution != 1) {
302-
// resample on the fly - faster, less accurate
241+
if (resolution != 1)
242+
{
303243
mapnik::grid2utf<T>(grid_type,l,key_order,resolution);
304-
305-
// resample first - slower, more accurate
306-
//mapnik::grid2utf2<T>(grid_type,l,key_order,resolution);
307244
}
308245
else
309246
{

src/python_grid_utils.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ void grid2utf(T const& grid_type,
4545
unsigned int resolution);
4646

4747

48-
template <typename T>
49-
void grid2utf2(T const& grid_type,
50-
boost::python::list& l,
51-
std::vector<typename T::lookup_type>& key_order,
52-
unsigned int resolution);
53-
54-
5548
template <typename T>
5649
void write_features(T const& grid_type,
5750
boost::python::dict& feature_data,

0 commit comments

Comments
 (0)