2011-04-26 23:51:29 +00:00
|
|
|
/*****************************************************************************
|
2011-11-14 03:54:32 +00:00
|
|
|
*
|
2011-04-26 23:51:29 +00:00
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
2014-11-20 14:25:50 +00:00
|
|
|
* Copyright (C) 2014 Artem Pavlenko
|
2011-04-26 23:51:29 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
|
|
|
// boost
|
|
|
|
#include <boost/python.hpp>
|
|
|
|
|
|
|
|
// mapnik
|
2012-07-23 18:43:24 +00:00
|
|
|
#include <mapnik/map.hpp>
|
2011-04-26 23:51:29 +00:00
|
|
|
#include <mapnik/grid/grid.hpp>
|
2011-06-04 00:28:00 +00:00
|
|
|
|
2011-04-26 23:51:29 +00:00
|
|
|
namespace mapnik {
|
|
|
|
|
|
|
|
|
2011-06-04 00:28:00 +00:00
|
|
|
template <typename T>
|
2012-07-23 18:43:24 +00:00
|
|
|
void grid2utf(T const& grid_type,
|
2011-11-14 03:54:32 +00:00
|
|
|
boost::python::list& l,
|
2012-07-23 18:43:24 +00:00
|
|
|
std::vector<typename T::lookup_type>& key_order);
|
2011-06-04 00:28:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
2012-07-23 18:43:24 +00:00
|
|
|
void grid2utf(T const& grid_type,
|
2011-11-14 03:54:32 +00:00
|
|
|
boost::python::list& l,
|
|
|
|
std::vector<typename T::lookup_type>& key_order,
|
2012-07-23 18:43:24 +00:00
|
|
|
unsigned int resolution);
|
2011-04-26 23:51:29 +00:00
|
|
|
|
|
|
|
|
2011-06-04 00:28:00 +00:00
|
|
|
template <typename T>
|
2012-07-23 18:43:24 +00:00
|
|
|
void grid2utf2(T const& grid_type,
|
2011-11-14 03:54:32 +00:00
|
|
|
boost::python::list& l,
|
|
|
|
std::vector<typename T::lookup_type>& key_order,
|
2012-07-23 18:43:24 +00:00
|
|
|
unsigned int resolution);
|
2011-06-04 00:28:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
2012-07-23 18:43:24 +00:00
|
|
|
void write_features(T const& grid_type,
|
2011-11-14 03:54:32 +00:00
|
|
|
boost::python::dict& feature_data,
|
2012-07-23 18:43:24 +00:00
|
|
|
std::vector<typename T::lookup_type> const& key_order);
|
2011-06-04 00:28:00 +00:00
|
|
|
|
|
|
|
template <typename T>
|
2012-07-23 18:43:24 +00:00
|
|
|
void grid_encode_utf(T const& grid_type,
|
2011-11-14 03:54:32 +00:00
|
|
|
boost::python::dict & json,
|
|
|
|
bool add_features,
|
2012-07-23 18:43:24 +00:00
|
|
|
unsigned int resolution);
|
2011-06-04 00:28:00 +00:00
|
|
|
|
|
|
|
template <typename T>
|
2012-08-16 11:05:31 +00:00
|
|
|
boost::python::dict grid_encode( T const& grid, std::string const& format, bool add_features, unsigned int resolution);
|
2011-06-04 00:28:00 +00:00
|
|
|
|
2012-07-23 18:43:24 +00:00
|
|
|
void render_layer_for_grid(const mapnik::Map& map,
|
2014-08-12 12:40:45 +00:00
|
|
|
mapnik::grid& grid,
|
|
|
|
unsigned layer_idx, // TODO - layer by name or index
|
2014-09-12 22:50:00 +00:00
|
|
|
boost::python::list const& fields,
|
|
|
|
double scale_factor,
|
|
|
|
unsigned offset_x,
|
|
|
|
unsigned offset_y);
|
2011-04-26 23:51:29 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // MAPNIK_PYTHON_BINDING_GRID_UTILS_INCLUDED
|