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:
I have tried without succes to use
QList<double> no_data_values{ std::nan("") };
Hi @apalomer-iqua.
I pulled down your test project and got it built locally. I was going to recommend using a raster mask function, but it looks like you beat me to it here: https://bitbucket.org/apalomeriqua/arcgis_test/src/24056f737a006278fa6ff7934d83e129bbd1b4ee/src/test...
Testing it out locally with version 200.6.0 does have the desired effect for me on macOS. It should be the same on Linux or other platforms as well.
And with the basemap present and all layers visible:
Is this what you were trying to achieve?
For the question about color scales, you would need to use Colormap and ColormapRenderer instead of the BlendRenderer.
https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-colormap.html
https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-colormaprenderer.html