MapView mMapView;
......
String rasterPath = Environment.getExternalStorageDirectory().getPath() + "/raster/test.tif";
FileRasterSource rasterSource;
try {
rasterSource = new FileRasterSource(rasterPath);
} catch (IllegalArgumentException ie) {
Log.d(TAG, "null or empty path");
} catch (FileNotFoundException fe) {
Log.d(TAG, "raster file doesn't exist");
} catch (RuntimeException re) {
Log.d(TAG, "raster file can't be opened");
}
RasterLayer rasterLayer = new RasterLayer(rasterSource);
mMapView.addLayer(rasterLayer);

相关文章:

  • 2022-01-05
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-04-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案