ArcGIS Pro栅格修改大小另存

摘要:
System.Uri=newUri(“e:\ESRI_GDB\Southampton.GDB”);QueuedTask。运行(()=˃{FileGeodatabaseConnectionPathpath=newFileGeodatabaseConnection path(uri);Geodatabasedb=newGeodatabase(path);RasterDatagrasterD
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
  });

免责声明:文章转载自《ArcGIS Pro栅格修改大小另存》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇ElasticSearch-7.10安装-2使用Cookie实现账号共享下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

arcengine 开发经典帖 【强烈推荐仔细研读】

转自原文 arcengine 开发经典帖 使用ArcGIS Engine 开发自定义GIS应用:第一部分:使用ArcGIS Engine 发布自定义GIS应用软件-全面了解ArcGIS Engine的产品。第二部分:ArcEngine9.2的新特性及变化、(续)--类对比及变化、(续)--(代码转换插件)、(续)--ArcEngine新命令,工具、菜单...

ArcGis 中空间数据的插入与更新

1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.UI; 6 using System.Web.UI.WebControls; 7 using ESRI.A...

关于ArcGis for javascript的使用

1.引用ArcGis for javascript核心类库的两种方式: 1.1.下载js包,解压缩放入项目中 1.1.1.下载核心类库压缩文件, 下载地址: https://developers.arcgis.com/downloads/ 1.1.2.将下载好的文件解压缩放入项目 1.1.3.更改核心类库中的相关文件中的路径   1> 更改 ../...

ArcGIS Enterprise 10.5.1 静默安装部署记录(Centos 7.2 minimal)- 3、安装Portal for ArcGIS

安装Portal for ArcGIS 解压portal安装包,tar -xzvf Portal_for_ArcGIS_Linux_1051_156440.tar.gz 切换到arcgis账户静默安装portal,./Setup -m silent -l yes 参数说明 根据安装提示报出如下错误信息。 要增加软限制和硬限制,您需要使用超级...

ArcGIS Server服务状态正在停止。。。问题BUG解决

1、ArcGIS Server服务器出现服务问题:ArcGIS Server Manager的所有服务显示为“正在停止……“。 2、N种解决方式 1)端口占用问题。4000-4002端口被其他程序占用过,导致服务无法正常启动。 可以通过CMD查找相关PID被占用的端口,停掉,再启动GIS服务即可; 也可以手动改为安装目录下的D:\Program Files...

《ArcGIS Runtime SDK for Android开发笔记》——(11)、ArcGIS Runtime SDK常见空间数据加载

 ArcGIS Runtime SDK for Android 支持多种类型空间数据源、每一种都提供了相应的图层来直接加载,图层Layer是空间数据的载体,其主要继承关系及类型说明如下图所示: 转载请注明出处:http://www.cnblogs.com/gis-luq/p/5062715.html 1、图层分类解析 Layer是所有图层的基类,声明了空...