示例#1
0
mapnik::parameter get_params_by_index(mapnik::parameters const& p, int index)
{
    if (index < 0 || static_cast<unsigned>(index) > p.size())
    {
        PyErr_SetString(PyExc_IndexError, "Index is out of range");
        throw boost::python::error_already_set();
    }

    parameters::const_iterator itr = p.begin();
    std::advance(itr, index);
    if (itr != p.end())
    {
        return *itr;
    }
    PyErr_SetString(PyExc_IndexError, "Index is out of range");
    throw boost::python::error_already_set();
}
示例#2
0
unsigned get_params_size(mapnik::parameters const& p)
{
    return p.size();
}