Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 關於android開發 >> andriod arcgis加載影像TIF,andriodarcgis

andriod arcgis加載影像TIF,andriodarcgis

編輯:關於android開發

andriod arcgis加載影像TIF,andriodarcgis


  private static final String TAG = "MainActivity";
    private MapView mapView = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        this.mapView = (MapView)this.findViewById(R.id.map);
        String rasterPath = Environment.getExternalStorageDirectory().getPath() +"/ArcGIS/samples/Raster/QL_IMage.tif"; //QL_IMage.tif,Landsat8Hawaii_naturecolor.tif

        FileRasterSource rasterSource =null;
        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);
        this.mapView.addLayer(rasterLayer);

 

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved