Cannot Distinguish Between GeoPackage Rasters

624
2
04-29-2020 04:00 AM
FridjofSchmidt
Occasional Contributor

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

Tags (2)
0 Kudos
2 Replies
GayleYoung
Esri Contributor

Hello Fridjof,

supplying the full Raster path with a name/Id at the end was supported in 100.4 and so is a known regression for us. The issue is in our pipeline to fix and I have added your concern to that issue.

Thanks for your feedback,

Gayle.

FridjofSchmidt
Occasional Contributor

Thank you Gayle, good to know that you are looking into this!

0 Kudos