I am evaluating the ArcGIS Maps SDK for Qt to see if it fits our needs. To test it, I have done a small project for a map and scene viewer. In both viewers, I import a GeoTIF (data/bathymetry.tif) which is an elevation map of the seabed. This image contains negative values and the areas that are not covered, are set to NaN. My test code paints that image using a BlendRenderer and a ColorRamp:
Esri::ArcGISRuntime::Raster *elevation_raster = new Esri::ArcGISRuntime::Raster(bathymetryPath(), parent);
Esri::ArcGISRuntime::RasterLayer *raster_layer_color_ramp =
new Esri::ArcGISRuntime::RasterLayer(elevation_raster, parent);
QList<double> output_min_values;
QList<double> output_max_values;
QList<double> source_min_values{ -16 };
QList<double> source_max_values{ 0 };
QList<double> no_data_values;
QList<double> gammas;
double altitude = 50.;
double azimuth = 15.;
double z_factor = 1.;
double pixel_size_factor = 1.;
double pixel_size_power = 1.;
int output_bit_depth = 8;
Esri::ArcGISRuntime::ColorRamp *color_ramp =
Esri::ArcGISRuntime::ColorRamp::create(Esri::ArcGISRuntime::PresetColorRampType::Elevation, 800, parent);
Esri::ArcGISRuntime::BlendRenderer *renderer = new Esri::ArcGISRuntime::BlendRenderer(
elevation_raster, output_min_values, output_max_values, source_min_values, source_max_values, no_data_values,
gammas, color_ramp, altitude, azimuth, z_factor, Esri::ArcGISRuntime::SlopeType::Scaled, pixel_size_factor,
pixel_size_power, output_bit_depth, parent);
raster_layer_color_ramp->setRenderer(renderer);
The result is the following:
Which is not displayed as I expect it because the non-covered area of the seabed is also painted.
I have two questions:
- How can I make the NaN values transparent?
- Is there any way to paint it with color scale such as the following one? Maybe also combine it with the shading effect of how it is now colored?
