-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathpython_grid_utils.hpp
More file actions
73 lines (59 loc) · 2.53 KB
/
python_grid_utils.hpp
File metadata and controls
73 lines (59 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2024 Artem Pavlenko
*
* 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
*
*****************************************************************************/
#ifndef MAPNIK_PYTHON_BINDING_GRID_UTILS_INCLUDED
#define MAPNIK_PYTHON_BINDING_GRID_UTILS_INCLUDED
// mapnik
#include <mapnik/map.hpp>
#include <mapnik/grid/grid.hpp>
// pybind11
#include <pybind11/pybind11.h>
namespace py = pybind11;
namespace mapnik {
template <typename T>
void grid2utf(T const& grid_type,
py::list& l,
std::vector<typename T::lookup_type>& key_order);
template <typename T>
void grid2utf(T const& grid_type,
py::list& l,
std::vector<typename T::lookup_type>& key_order,
unsigned int resolution);
template <typename T>
void write_features(T const& grid_type,
py::dict& feature_data,
std::vector<typename T::lookup_type> const& key_order);
template <typename T>
void grid_encode_utf(T const& grid_type,
py::dict & json,
bool add_features,
unsigned int resolution);
template <typename T>
py::dict grid_encode( T const& grid, std::string const& format, bool add_features, unsigned int resolution);
void render_layer_for_grid(const mapnik::Map& map,
mapnik::grid& grid,
unsigned layer_idx, // TODO - layer by name or index
py::list const& fields,
double scale_factor,
unsigned offset_x,
unsigned offset_y);
}
#endif // MAPNIK_PYTHON_BINDING_GRID_UTILS_INCLUDED