Esri / arcgis-runtime-samples-android

ArcGIS Runtime SDK for Android Samples

Home Page:https://developers.arcgis.com/android/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to remove background .tif file of raster feature ?

iam-febriansyah opened this issue · comments

Hi,

I'm already showing raster from .tif file with and without background.
When i load .tif without background the raster showing red background.
How to remove background?
Thanks if anyone can help.

Behavior

This is my code
File directory = new File(getActivity().getResources().getString(R.string.eplanningPath));
if (!directory.exists()) {
directory.mkdir();
}

File rootFile = new File(getActivity().getResources().getString(R.string.eplanningPath));

if (rootFile.listFiles().length > 0) {
for (File file : rootFile.listFiles()) {
if (file.getName().endsWith(".tif")) {
raster.add(new Raster(new File(getActivity().getResources().getString(R.string.eplanningPath) + "/" + file.getName()).getAbsolutePath()));
}
}
}

for (Raster r : raster) {
RasterLayer rasterLayer = new RasterLayer(r);
map.getOperationalLayers().add(rasterLayer);
rasterLayer.addDoneLoadingListener(() -> {
if (rasterLayer.getLoadStatus() != LoadStatus.LOADED) {}
});
}

sorry duplicate