当前位置: 首页>>代码示例>>Java>>正文


Java RasterLayer类代码示例

本文整理汇总了Java中com.esri.android.map.RasterLayer的典型用法代码示例。如果您正苦于以下问题:Java RasterLayer类的具体用法?Java RasterLayer怎么用?Java RasterLayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RasterLayer类属于com.esri.android.map包,在下文中一共展示了RasterLayer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addRasterGpkg

import com.esri.android.map.RasterLayer; //导入依赖的package包/类
private void addRasterGpkg(String path) {
    try {
        MapView map = getMapView();
        FileRasterSource src = new FileRasterSource(path);
        rasterSources.add(src);
        src.project(map.getSpatialReference());
        RasterLayer layer = new RasterLayer(src);
        layer.setRenderer(RGB_RENDERER);
        layer.setName((path.contains("/") ? path.substring(path.lastIndexOf("/") + 1) : path) + " (raster)");
        map.addLayer(layer);
    } catch (FileNotFoundException e) {
        Log.d(TAG, null, e);
    }
}
 
开发者ID:garys-esri,项目名称:gpkg-viewer-android,代码行数:15,代码来源:GpkgViewerActivity.java

示例2: loadRasterAsBasemap

import com.esri.android.map.RasterLayer; //导入依赖的package包/类
public void loadRasterAsBasemap() {
  if (mMapView == null) {
    return;
  }

  try {
    mMapView.removeAll();
    // Create a RasterSource from a local raster file
    FileRasterSource rasterSource = new FileRasterSource(mPathLayer);
    // Create a raster layer from the RasterSource
    mRasterLayer = new RasterLayer(rasterSource);
    // allow to zoom in after the largest LOD for the Landsat 8 image
    mRasterLayer.setMaxScale(200000);
    // Add the raster layer to the map view
    mMapView.addLayer(mRasterLayer);
    // Set RGBRenderer
    applyRGBRenderer(true);

    // Set the extent
    Envelope initialExtent = new Envelope(-157.4368965374797, 20.516069728186316, -155.81463794462434, 21.298471528698848);
    mMapView.setExtent(initialExtent);

    // Add a graphics layer
    mGraphicsLayer = new GraphicsLayer();
    mMapView.addLayer(mGraphicsLayer);

  } catch (FileNotFoundException | RuntimeException e) {
    e.printStackTrace();
  }

}
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:32,代码来源:RasterAnalysisHelper.java

示例3: calculateViewshed

import com.esri.android.map.RasterLayer; //导入依赖的package包/类
public void calculateViewshed() {
  if ((mMapView == null) || (!mMapView.isLoaded())
      || (mPathTask == null) || (mPathTask.isEmpty())) {
    return;
  }

  // clear any analysis layers showing
  turnOffFunctionLayers();

  // create a viewshed function
  try {
    mViewshed = new Viewshed(mPathTask);
    // Change the observer z offset
    mViewshed.setObserverZOffset(50);
  } catch (FileNotFoundException | RuntimeException e) {
    e.printStackTrace();
    return;
  }

  if (mViewshed != null) {
    // Obtain the outout RasterSource from viewshed function
    FunctionRasterSource functionRS = mViewshed.getOutputFunctionRasterSource();
    // Create a raster layer from the RasterSource and add it to the map view
    mViewShedLayer = new RasterLayer(functionRS);
    mMapView.addLayer(mViewShedLayer);
    // Change the renderer
    setRenderer4Viewshed(mViewShedLayer);

    // Set gesture used to change the position of the observer
    mMapView.setOnTouchListener(new OnTouchListenerViewshed(mMapView
        .getContext(), mMapView, mViewshed));
  }

}
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:35,代码来源:RasterAnalysisHelper.java

示例4: setRenderer4Viewshed

import com.esri.android.map.RasterLayer; //导入依赖的package包/类
private void setRenderer4Viewshed(RasterLayer rasterLayer) {
  List<Colormap.UniqueValue> values = new ArrayList<Colormap.UniqueValue>();
  values.add(new Colormap.UniqueValue(1, Color.GREEN, "visible"));

  ColormapRenderer renderer = new ColormapRenderer();
  Colormap colormap = new Colormap();
  colormap.setUniqueValues(values);
  renderer.setColormap(colormap);

  rasterLayer.setRenderer(renderer);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:12,代码来源:RasterAnalysisHelper.java


注:本文中的com.esri.android.map.RasterLayer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。