• ArcGIS Pro栅格修改大小另存


    System.Uri uri = new Uri("e:\ESRI_GDB\Southampton.gdb");
    
    QueuedTask.Run(() =>
    {
    
       FileGeodatabaseConnectionPath path = new FileGeodatabaseConnectionPath(uri);
    
       Geodatabase gdb = new Geodatabase(path);
    
       RasterDataset rasterDataset = gdb.OpenDataset<RasterDataset>("Raster_250");
    
       Raster raster = rasterDataset.CreateFullRaster();
    
       SpatialReference spatialReference = SpatialReferenceBuilder.CreateSpatialReference(27700);
    
       raster.SetSpatialReference(spatialReference);
    
       Envelope ext = EnvelopeBuilder.CreateEnvelope(400000, 100000, 450000, 150000, spatialReference); // select an area
    
       int W = raster.GetWidth(); // original raster is 4040 columns
       int H = raster.GetHeight(); // 3880 rows
    
       raster.SetWidth(500);   // try to set the size of the output raster
       raster.SetHeight(500);
    
       W = raster.GetWidth(); // still 4040 columns
       H = raster.GetHeight(); // correct at 500 rows
    
       raster.SetExtent(ext); // select teh geographic area of interest
    
       FileSystemConnectionPath connectionPath = new FileSystemConnectionPath(new System.Uri(@"C:Dummy"),    FileSystemDatastoreType.Raster);
       FileSystemDatastore dataStore = new FileSystemDatastore(connectionPath);
    
       RasterStorageDef rasterStorageDef = new RasterStorageDef();
       rasterStorageDef.SetPyramidLevel(0); // don't want pyramids
    
       raster.SaveAs("bbtest.tif", dataStore, "TIFF", rasterStorageDef); // creates long thin distorted raster of the correct geographic area
      });
  • 相关阅读:
    mysql函数操作(5)
    mysql函数操作(4)
    mysql函数操作(3)
    mysql函数操作(2)
    mysql函数操作
    绑定列
    iOS-Xcode解决【workspace integrity couldn't load project'】
    iOS-常用的两个弹簧动画pop
    iOS-实现后台长时间运行
    iOS-xcconfig环境变量那些事(配置环境的配置)
  • 原文地址:https://www.cnblogs.com/gisoracle/p/12629294.html
Copyright © 2020-2023  润新知