Hello folks,
Starting from Raster Layer GeoPackage | ArcGIS for Developers I wrote some code that loads rasters from a GeoPackage into a map. This works as expected. But up to now I am unable to tell which raster is which, because the name of the raster in the GeoPackage does not appear anywhere.
What I tried:
for (GeoPackageRaster r: rasters) {
r.addDoneLoadingListener(() -> {
String desc = r.getDescription();
String path = r.getPath();
Log.d(TAG, "Raster Path: " + path + ", Description: " + desc);
});
// create a layer to show the raster
RasterLayer geoPackageRasterLayer = new RasterLayer(r);
geoPackageRasterLayer.addDoneLoadingListener(() -> {
String name = geoPackageRasterLayer.getName();
String desc = geoPackageRasterLayer.getDescription();
Log.d(TAG, "Layer Name: " + name + ", Description: " + desc);
});
mMapView.getMap().getOperationalLayers().add(geoPackageRasterLayer);
}
What seems strange to me is that the raster path always returns the path to the GeoPackage, but not to the raster within the GeoPackage. Is this a bug? Also, the description returns an empty string, and a getName method does not exist. I wouldn't expect the RasterLayer to return a name or description if it was not set explicitly, but I tried just to make sure (and it doesn't).
In my app, I need to tell the rasters apart in order to assign scale ranges etc. to the layers. Storing each raster in a separate GeoPackage is not an option.
Shouldn't there be a property or method to get more info about a GeoPackage raster?
Thanks for any suggestions
Fridjof