I try to load local tif files with flowing codes (I do not set any license), but get errors, I make sure the path is ok, and the tif file can be opened in other GIS software.
so how to load the local tif files?
my code:
val path = Environment.getExternalStorageDirectory().absolutePath + "/tiftest/tiftest/tiftest.tif"
val raster = Raster.createWithPath(path)
val rasterLayer = RasterLayer(raster)
activity.lifecycleScope.launch {
rasterLayer.load().onSuccess {
map!!.operationalLayers.add(rasterLayer)
}.onFailure {
it.printStackTrace()
Log.e("TAG", "Raster layer failed to load.")
}
}
error info :
