diff --git a/bindings/python/mapnik_raster_colorizer.cpp b/bindings/python/mapnik_raster_colorizer.cpp index 7d9d6b755..758d19dd2 100644 --- a/bindings/python/mapnik_raster_colorizer.cpp +++ b/bindings/python/mapnik_raster_colorizer.cpp @@ -60,6 +60,15 @@ void add_stop5(raster_colorizer_ptr &rc, float v, colorizer_mode_enum m, color c colorizer_stop stop(v, m, c); rc->add_stop(stop); } +mapnik::color get_color(raster_colorizer_ptr &rc, float value) { + unsigned rgba = rc->get_color(value); + unsigned r = (rgba & 0xff); + unsigned g = (rgba >> 8 ) & 0xff; + unsigned b = (rgba >> 16) & 0xff; + unsigned a = (rgba >> 24) & 0xff; + return mapnik::color(r,g,b,a); +} + colorizer_stops const& get_stops(raster_colorizer_ptr & rc) { return rc->get_stops(); @@ -142,7 +151,7 @@ void export_raster_colorizer() ">>> colorizer = mapnik.RasterColorizer(mapnik.COLORIZER_LINEAR, default_color)\n" ">>> colorizer.add_stop(100, mapnik.COLORIZER_DISCRETE, mapnik.Color(\"#112233\"))\n" ) - .def("get_color", &raster_colorizer::get_color, + .def("get_color", get_color, "Get the color assigned to a certain value in raster data.\n" "\n" "Usage:\n" diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index 2b399f6a7..c3f0d54e9 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -203,6 +203,13 @@ inline std::ostream& operator<< (std::ostream& os, invert) return os; } +inline std::ostream& operator<< (std::ostream& os, colorize_alpha const& filter) +{ + os << "colorize-alpha(TODO)"; + return os; +} + + template struct to_string_visitor : boost::static_visitor { diff --git a/include/mapnik/raster.hpp b/include/mapnik/raster.hpp index 4b1ce1cfb..b1069b7cc 100644 --- a/include/mapnik/raster.hpp +++ b/include/mapnik/raster.hpp @@ -28,6 +28,9 @@ #include #include + // boost +#include + namespace mapnik { class raster : private mapnik::noncopyable { @@ -35,11 +38,22 @@ public: box2d ext_; image_data_32 data_; bool premultiplied_alpha_; + boost::optional nodata_; raster(box2d const& ext, unsigned width, unsigned height, bool premultiplied_alpha = false) : ext_(ext), data_(width,height), premultiplied_alpha_(premultiplied_alpha) {} + + void set_nodata(double nodata) + { + nodata_ = nodata; + } + + boost::optional const& nodata() const + { + return nodata_; + } }; } diff --git a/include/mapnik/raster_colorizer.hpp b/include/mapnik/raster_colorizer.hpp index e36d54608..2c78108c5 100644 --- a/include/mapnik/raster_colorizer.hpp +++ b/include/mapnik/raster_colorizer.hpp @@ -199,7 +199,6 @@ public: //! \brief Colorize a raster //! //! \param[in, out] raster A raster stored in float32 single channel format, which gets colorized in place. - //! \param[in] f The feature used to find 'NODATA' information if available void colorize(std::shared_ptr const& raster, feature_impl const& f) const; @@ -207,7 +206,7 @@ public: //! //! \param[in] value Input value //! \return color associated with the value - color get_color(float value) const; + unsigned get_color(float value) const; //! \brief Set the epsilon value for exact mode diff --git a/plugins/input/gdal/gdal_datasource.cpp b/plugins/input/gdal/gdal_datasource.cpp index 841d62631..54de7a6db 100644 --- a/plugins/input/gdal/gdal_datasource.cpp +++ b/plugins/input/gdal/gdal_datasource.cpp @@ -108,6 +108,7 @@ gdal_datasource::gdal_datasource(parameters const& params) nbands_ = dataset->GetRasterCount(); width_ = dataset->GetRasterXSize(); height_ = dataset->GetRasterYSize(); + desc_.add_descriptor(mapnik::attribute_descriptor("nodata", mapnik::Integer)); double tr[6]; bool bbox_override = false; diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index 642ca2eda..d2d0f13f5 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -75,8 +75,7 @@ gdal_featureset::gdal_featureset(GDALDataset& dataset, nodata_value_(nodata), first_(true) { - ctx_->push("value"); - ctx_->push("NODATA"); + ctx_->push("nodata"); } gdal_featureset::~gdal_featureset() @@ -115,7 +114,8 @@ feature_ptr gdal_featureset::next() feature_ptr gdal_featureset::get_feature(mapnik::query const& q) { feature_ptr feature = feature_factory::create(ctx_,1); - + int raster_has_nodata = 0; + double raster_nodata = 0; GDALRasterBand * red = 0; GDALRasterBand * green = 0; GDALRasterBand * blue = 0; @@ -229,91 +229,60 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) { throw datasource_exception((boost::format("GDAL Plugin: '%d' is an invalid band, dataset only has '%d' bands\n") % band_ % nbands_).str()); } - float* imageData = (float*)image.getBytes(); GDALRasterBand * band = dataset_.GetRasterBand(band_); - int hasNoData(0); - double nodata(0); - if (nodata_value_) - { - hasNoData = 1; - nodata = *nodata_value_; - } - else - { - nodata = band->GetNoDataValue(&hasNoData); - } + raster_nodata = band->GetNoDataValue(&raster_has_nodata); band->RasterIO(GF_Read, x_off, y_off, width, height, imageData, image.width(), image.height(), GDT_Float32, 0, 0); - - if (hasNoData) - { - feature->put("NODATA",nodata); - } } else // working with all bands { for (int i = 0; i < nbands_; ++i) { GDALRasterBand * band = dataset_.GetRasterBand(i + 1); - #ifdef MAPNIK_LOG get_overview_meta(band); #endif - GDALColorInterp color_interp = band->GetColorInterpretation(); switch (color_interp) { case GCI_RedBand: red = band; - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found red band"; - break; case GCI_GreenBand: green = band; - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found green band"; - break; case GCI_BlueBand: blue = band; - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found blue band"; - break; case GCI_AlphaBand: alpha = band; - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found alpha band"; - break; case GCI_GrayIndex: grey = band; - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found gray band"; - break; case GCI_PaletteIndex: { grey = band; #ifdef MAPNIK_LOG MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found gray band, and colortable..."; - GDALColorTable *color_table = band->GetColorTable(); if (color_table) { int count = color_table->GetColorEntryCount(); - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Color Table count=" << count; for (int j = 0; j < count; j++) { const GDALColorEntry *ce = color_table->GetColorEntry (j); if (! ce) continue; - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Color entry RGB=" << ce->c1 << "," <c2 << "," << ce->c3; } } @@ -322,50 +291,33 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) } case GCI_Undefined: MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming gray band)"; - grey = band; break; default: MAPNIK_LOG_WARN(gdal) << "gdal_featureset: Band type unknown!"; - break; } } - if (red && green && blue) { MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Processing rgb bands..."; - - int hasNoData = 0; - double nodata = 0.0; - if (nodata_value_) - { - hasNoData = 1; - nodata = *nodata_value_; - } - else - { - nodata = red->GetNoDataValue(&hasNoData); - } - if (hasNoData) - { - feature->put("NODATA",nodata); - } + raster_nodata = red->GetNoDataValue(&raster_has_nodata); GDALColorTable *color_table = red->GetColorTable(); - - if (! alpha && hasNoData && ! color_table) + if (!alpha && raster_has_nodata && !color_table) { - // first read the data in and create an alpha channel from the nodata values + // read the data in and create an alpha channel from the nodata values + // NOTE: we intentionally ignore user supplied nodata value since it only + // works for grayscale images or a single band (as a double) + // TODO - we assume here the nodata value for the red band applies to all band + // but that may not always be the case: http://trac.osgeo.org/gdal/ticket/2734 float* imageData = (float*)image.getBytes(); red->RasterIO(GF_Read, x_off, y_off, width, height, imageData, image.width(), image.height(), GDT_Float32, 0, 0); - int len = image.width() * image.height(); - for (int i = 0; i < len; ++i) { - if (nodata == imageData[i]) + if (std::fabs(raster_nodata - imageData[i]) < 1e-12) { *reinterpret_cast(&imageData[i]) = 0; } @@ -374,9 +326,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) *reinterpret_cast(&imageData[i]) = 0xFFFFFFFF; } } - } - red->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 0, image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); green->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 1, @@ -387,46 +337,31 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) else if (grey) { MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Processing gray band..."; - - int hasNoData(0); - double nodata(0); - if (nodata_value_) - { - hasNoData = 1; - nodata = *nodata_value_; - } - else - { - nodata = grey->GetNoDataValue(&hasNoData); - } + raster_nodata = grey->GetNoDataValue(&raster_has_nodata); GDALColorTable* color_table = grey->GetColorTable(); - - if (hasNoData && ! color_table) + bool has_nodata = nodata_value_ || raster_has_nodata; + if (!color_table && has_nodata) { - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: No data value for layer=" << nodata; - - feature->put("NODATA",nodata); + double apply_nodata = nodata_value_ ? *nodata_value_ : raster_nodata; + MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: applying nodata value for layer=" << apply_nodata; // first read the data in and create an alpha channel from the nodata values float* imageData = (float*)image.getBytes(); grey->RasterIO(GF_Read, x_off, y_off, width, height, imageData, image.width(), image.height(), GDT_Float32, 0, 0); - int len = image.width() * image.height(); - for (int i = 0; i < len; ++i) { - if (nodata == imageData[i]) + if (std::fabs(apply_nodata - imageData[i]) < 1e-12) { *reinterpret_cast(&imageData[i]) = 0; } else { - *reinterpret_cast (&imageData[i]) = 0xFFFFFFFF; + *reinterpret_cast(&imageData[i]) = 0xFFFFFFFF; } } } - grey->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 0, image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); grey->RasterIO(GF_Read,x_off, y_off, width, height, image.getBytes() + 1, @@ -436,38 +371,23 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) if (color_table) { - MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Loading colour table..."; - - unsigned nodata_value = static_cast(std::floor(nodata+.5)); // FIXME: is it realy unsigned ? - if (hasNoData) - { - feature->put("NODATA",static_cast(nodata_value)); - } + MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Loading color table..."; for (unsigned y = 0; y < image.height(); ++y) { unsigned int* row = image.getRow(y); for (unsigned x = 0; x < image.width(); ++x) { unsigned value = row[x] & 0xff; - if (hasNoData && (value == nodata_value)) + const GDALColorEntry *ce = color_table->GetColorEntry(value); + if (ce) { - // make no data fully alpha - row[x] = 0; + row[x] = (ce->c4 << 24)| (ce->c3 << 16) | (ce->c2 << 8) | (ce->c1) ; } else { - const GDALColorEntry *ce = color_table->GetColorEntry(value); - if (ce) - { - // TODO - big endian support - row[x] = (ce->c4 << 24)| (ce->c3 << 16) | (ce->c2 << 8) | (ce->c1) ; - } - else - { - // make lacking color entry fully alpha - // note - gdal_translate makes black - row[x] = 0; - } + // make lacking color entry fully alpha + // note - gdal_translate makes black + row[x] = 0; } } } @@ -476,11 +396,28 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) if (alpha) { MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: processing alpha band..."; - + if (raster_has_nodata) + { + MAPNIK_LOG_ERROR(gdal) << "warning: alpha channel being used instead of nodata value"; + } alpha->RasterIO(GF_Read, x_off, y_off, width, height, image.getBytes() + 3, image.width(), image.height(), GDT_Byte, 4, 4 * image.width()); } } + // set nodata value to be used in raster colorizer + if (nodata_value_) + { + raster->set_nodata(*nodata_value_); + } + else + { + raster->set_nodata(raster_nodata); + } + // report actual/original source nodata in feature attributes + if (raster_has_nodata) + { + feature->put("nodata",raster_nodata); + } return feature; } } @@ -514,19 +451,22 @@ feature_ptr gdal_featureset::get_feature_at_point(mapnik::coord2d const& pt) MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: x=" << x << " y=" << y; GDALRasterBand* band = dataset_.GetRasterBand(band_); - int hasNoData; - double nodata = band->GetNoDataValue(&hasNoData); + int raster_has_nodata; + double nodata = band->GetNoDataValue(&raster_has_nodata); double value; band->RasterIO(GF_Read, x, y, 1, 1, &value, 1, 1, GDT_Float64, 0, 0); - - if (! hasNoData || value != nodata) + if (! raster_has_nodata || value != nodata) { // construct feature feature_ptr feature = feature_factory::create(ctx_,1); geometry_type * point = new geometry_type(mapnik::geometry_type::types::Point); point->move_to(pt.x, pt.y); feature->add_geometry(point); - feature->put("value",value); + feature->put_new("value",value); + if (raster_has_nodata) + { + feature->put_new("nodata",nodata); + } return feature; } } diff --git a/src/raster_colorizer.cpp b/src/raster_colorizer.cpp index fbacb1212..6bc0c052b 100644 --- a/src/raster_colorizer.cpp +++ b/src/raster_colorizer.cpp @@ -127,25 +127,19 @@ void raster_colorizer::colorize(raster_ptr const& raster, feature_impl const& f) unsigned *imageData = raster->data_.getData(); int len = raster->data_.width() * raster->data_.height(); - - bool hasNoData = false; - float noDataValue = 0; - - //std::map::const_iterator fi = Props.find("NODATA"); - if (f.has_key("NODATA")) - { - hasNoData = true; - noDataValue = static_cast(f.get("NODATA").to_double()); - } - + boost::optional const& nodata = raster->nodata(); for (int i=0; i (&imageData[i]); - if (hasNoData && noDataValue == value) - imageData[i] = color(0,0,0,0).rgba(); + if (nodata && (std::fabs(value - *nodata) < epsilon_)) + { + imageData[i] = 0; + } else - imageData[i] = get_color(value).rgba(); + { + imageData[i] = get_color(value); + } } } @@ -154,14 +148,14 @@ inline unsigned interpolate(unsigned start, unsigned end, float fraction) return static_cast(fraction * ((float)end - (float)start) + start); } -color raster_colorizer::get_color(float value) const +unsigned raster_colorizer::get_color(float value) const { int stopCount = stops_.size(); //use default color if no stops if(stopCount == 0) { - return default_color_; + return default_color_.rgba(); } //1 - Find the stop that the value is in @@ -284,7 +278,7 @@ color raster_colorizer::get_color(float value) const MAPNIK_LOG_DEBUG(raster_colorizer) << "\toutputColor: " << outputColor.to_string(); */ - return outputColor; + return outputColor.rgba(); } diff --git a/tests/python_tests/images/support/tif_colortable.png b/tests/python_tests/images/support/tif_colortable.png deleted file mode 100644 index aa055bb45..000000000 Binary files a/tests/python_tests/images/support/tif_colortable.png and /dev/null differ diff --git a/tests/python_tests/images/support/vrt_colortable.png b/tests/python_tests/images/support/vrt_colortable.png deleted file mode 100644 index f885c68f8..000000000 Binary files a/tests/python_tests/images/support/vrt_colortable.png and /dev/null differ diff --git a/tests/python_tests/raster_colorizer_test.py b/tests/python_tests/raster_colorizer_test.py index 3bdb50941..9b8778d3f 100644 --- a/tests/python_tests/raster_colorizer_test.py +++ b/tests/python_tests/raster_colorizer_test.py @@ -9,22 +9,6 @@ def setup(): # from another directory we need to chdir() os.chdir(execution_path('.')) -def test_gen_map(): - mapxmlfile = '../data/good_maps/raster_colorizer.xml' - mapxmloutputfile = 'raster_colorizer_test_save.xml' - outputfile = 'raster_colorizer_test.png' - - m = mapnik.Map(800, 600) - try: - mapnik.load_map(m, mapxmlfile) - mapnik.save_map(m, mapxmloutputfile) - m.zoom_all() - mapnik.render_to_file(m, outputfile) - except RuntimeError,e: - # only test datasources that we have installed - if not 'Could not create datasource' in str(e): - raise RuntimeError(str(e)) - #test discrete colorizer mode def test_get_color_discrete(): #setup diff --git a/tests/python_tests/raster_colormapped_test.py b/tests/python_tests/raster_colormapped_test.py deleted file mode 100644 index de56346e0..000000000 --- a/tests/python_tests/raster_colormapped_test.py +++ /dev/null @@ -1,40 +0,0 @@ -#coding=utf8 -import os -import mapnik -from utilities import execution_path, run_all -from nose.tools import * - -def setup(): - # All of the paths used are relative, if we run the tests - # from another directory we need to chdir() - os.chdir(execution_path('.')) - -if 'gdal' in mapnik.DatasourceCache.plugin_names(): - - def test_vrt_rendering(): - m = mapnik.Map(512,512) - mapnik.load_map(m,'../data/good_maps/vrt_colortable.xml') - m.zoom_all() - im = mapnik.Image(512,512) - mapnik.render(m,im) - actual = '/tmp/vrt_colortable.png' - expected = 'images/support/vrt_colortable.png' - im.save(actual) - expected_im = mapnik.Image.open(expected) - eq_(im.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected)) - - def test_tif_rendering_nodata(): - m = mapnik.Map(512,512) - mapnik.load_map(m,'../data/good_maps/tiff_colortable.xml') - m.zoom_all() - im = mapnik.Image(512,512) - mapnik.render(m,im) - actual = '/tmp/tif_colortable.png' - expected = 'images/support/tif_colortable.png' - im.save(actual) - expected_im = mapnik.Image.open(expected) - eq_(im.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected(%s)' % (actual,'tests/python_tests/'+ expected)) - -if __name__ == "__main__": - setup() - run_all(eval(x) for x in dir() if x.startswith("test_")) diff --git a/tests/python_tests/raster_symbolizer_test.py b/tests/python_tests/raster_symbolizer_test.py index 826514af1..74ec4d990 100644 --- a/tests/python_tests/raster_symbolizer_test.py +++ b/tests/python_tests/raster_symbolizer_test.py @@ -90,7 +90,7 @@ def test_dataraster_query_point(): def test_load_save_map(): map = mapnik.Map(256,256) - in_map = "../data/good_maps/raster_symbolizer.xml" + in_map = "../visual_tests/styles/raster_symbolizer.xml" try: mapnik.load_map(map, in_map) diff --git a/tests/visual_tests/grids/raster_colorizer-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/raster_colorizer-512-512-1.0-grid-reference.json new file mode 100644 index 000000000..53162f357 --- /dev/null +++ b/tests/visual_tests/grids/raster_colorizer-512-512-1.0-grid-reference.json @@ -0,0 +1,136 @@ +{ + "keys": [ + "" + ], + "data": {}, + "grid": [ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + ] +} \ No newline at end of file diff --git a/tests/visual_tests/grids/raster_symbolizer-512-512-1.0-grid-reference.json b/tests/visual_tests/grids/raster_symbolizer-512-512-1.0-grid-reference.json new file mode 100644 index 000000000..53162f357 --- /dev/null +++ b/tests/visual_tests/grids/raster_symbolizer-512-512-1.0-grid-reference.json @@ -0,0 +1,136 @@ +{ + "keys": [ + "" + ], + "data": {}, + "grid": [ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + ] +} \ No newline at end of file diff --git a/tests/visual_tests/grids/vrt_colortable-256-256-1.0-grid-reference.json b/tests/visual_tests/grids/vrt_colortable-256-256-1.0-grid-reference.json new file mode 100644 index 000000000..e023c5e7e --- /dev/null +++ b/tests/visual_tests/grids/vrt_colortable-256-256-1.0-grid-reference.json @@ -0,0 +1,72 @@ +{ + "keys": [ + "" + ], + "data": {}, + "grid": [ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + ] +} \ No newline at end of file diff --git a/tests/visual_tests/images/raster_colorizer-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster_colorizer-512-512-1.0-agg-reference.png new file mode 100644 index 000000000..dec77cf5d Binary files /dev/null and b/tests/visual_tests/images/raster_colorizer-512-512-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/raster_colorizer-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster_colorizer-512-512-2.0-agg-reference.png new file mode 100644 index 000000000..dec77cf5d Binary files /dev/null and b/tests/visual_tests/images/raster_colorizer-512-512-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/raster_symbolizer-512-512-1.0-agg-reference.png b/tests/visual_tests/images/raster_symbolizer-512-512-1.0-agg-reference.png new file mode 100644 index 000000000..a7c34dc22 Binary files /dev/null and b/tests/visual_tests/images/raster_symbolizer-512-512-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/raster_symbolizer-512-512-2.0-agg-reference.png b/tests/visual_tests/images/raster_symbolizer-512-512-2.0-agg-reference.png new file mode 100644 index 000000000..a7c34dc22 Binary files /dev/null and b/tests/visual_tests/images/raster_symbolizer-512-512-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/vrt_colortable-256-256-1.0-agg-reference.png b/tests/visual_tests/images/vrt_colortable-256-256-1.0-agg-reference.png new file mode 100644 index 000000000..3fa463b51 Binary files /dev/null and b/tests/visual_tests/images/vrt_colortable-256-256-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/vrt_colortable-256-256-2.0-agg-reference.png b/tests/visual_tests/images/vrt_colortable-256-256-2.0-agg-reference.png new file mode 100644 index 000000000..3fa463b51 Binary files /dev/null and b/tests/visual_tests/images/vrt_colortable-256-256-2.0-agg-reference.png differ diff --git a/tests/data/good_maps/raster_colorizer.xml b/tests/visual_tests/styles/raster_colorizer.xml similarity index 96% rename from tests/data/good_maps/raster_colorizer.xml rename to tests/visual_tests/styles/raster_colorizer.xml index 970f252aa..8c1c91831 100644 --- a/tests/data/good_maps/raster_colorizer.xml +++ b/tests/visual_tests/styles/raster_colorizer.xml @@ -62,7 +62,7 @@ DISCRETE RAINBOW - ../raster/dataraster.tif + ../../data/raster/dataraster.tif gdal 1 diff --git a/tests/data/good_maps/raster_symbolizer.xml b/tests/visual_tests/styles/raster_symbolizer.xml similarity index 92% rename from tests/data/good_maps/raster_symbolizer.xml rename to tests/visual_tests/styles/raster_symbolizer.xml index 429701ca5..14632b103 100644 --- a/tests/data/good_maps/raster_symbolizer.xml +++ b/tests/visual_tests/styles/raster_symbolizer.xml @@ -26,7 +26,7 @@ ramped - ../raster/dataraster.tif + ../../data/raster/dataraster.tif gdal 1 diff --git a/tests/data/good_maps/vrt_colortable.xml b/tests/visual_tests/styles/vrt_colortable.xml similarity index 85% rename from tests/data/good_maps/vrt_colortable.xml rename to tests/visual_tests/styles/vrt_colortable.xml index d20367c72..f51088343 100644 --- a/tests/data/good_maps/vrt_colortable.xml +++ b/tests/visual_tests/styles/vrt_colortable.xml @@ -8,7 +8,7 @@ 2011_5km_vrt_nodata_style - ../raster/dataraster.vrt + ../../data/raster/dataraster.vrt gdal diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py index 47ff731b1..7140900d0 100755 --- a/tests/visual_tests/test.py +++ b/tests/visual_tests/test.py @@ -176,6 +176,9 @@ files = { 'dst-over-compositing':{'sizes':[(512,512)]}, 'tiff_colortable':{'sizes':[(256,256)]}, 'tiff_colortable_custom_nodata':{'sizes':[(256,256)]}, + 'vrt_colortable':{'sizes':[(256,256)]}, + 'raster_colorizer':{'sizes':[(512,512)]}, + 'raster_symbolizer':{'sizes':[(512,512)]}, } class Reporting: