zoukankan      html  css  js  c++  java
  • andriod arcgis加载影像TIF

    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);

  • 相关阅读:
    编译原理三大经典书籍
    c#之委托总结
    shell编程基础
    专家是什么?我真的想知道(转)
    linux sed
    判断一个脚本中的变量是否为空(转)
    JAVA Stack栈和Heap堆的区别(转)
    CMD获取当前目录的绝对路径 (转)
    RTP协议分析
    VS2010旗舰版安装图解
  • 原文地址:https://www.cnblogs.com/gisoracle/p/6392112.html
Copyright © 2011-2022 走看看