From e53914463aa9e7fe5f4e4ffe8441855ba22e85a1 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 19 Dec 2012 18:06:51 -0800 Subject: [PATCH] return the grid::value_type instead of hardcoding int --- bindings/python/mapnik_grid.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bindings/python/mapnik_grid.cpp b/bindings/python/mapnik_grid.cpp index 6f51c085b..1118d3b4b 100644 --- a/bindings/python/mapnik_grid.cpp +++ b/bindings/python/mapnik_grid.cpp @@ -39,13 +39,12 @@ bool painted(mapnik::grid const& grid) return grid.painted(); } -int get_pixel(mapnik::grid const& grid, int x, int y) +mapnik::grid::value_type get_pixel(mapnik::grid const& grid, int x, int y) { if (x < static_cast(grid.width()) && y < static_cast(grid.height())) { - mapnik::grid::value_type const * row = grid.getRow(y); - mapnik::grid::value_type const pixel = row[x]; - return pixel; + mapnik::grid::data_type const & data = grid.data(); + return data(x,y); } PyErr_SetString(PyExc_IndexError, "invalid x,y for grid dimensions"); boost::python::throw_error_already_set();