Arcgis中对矢量和栅格数据进行裁剪切割的方法

ArcGIS9: 
  ArcToolbox-->Spatail AnalystTools-->Extraction

ArcGIS8.X: 在ArcMap --> SpatialAnalyst扩展模块工具条--〉Raster  Calculator 或者直接使用Mask

 

1、对矢量数据进行裁减:Arctoolbox中,spatialtool>extract>clip
在InputFeatures中选择被裁剪的图层,在ClipFeatures中选择裁剪形状
2、利用矩形对栅格数据裁剪:Arctoolbox中,datamanagement>raster>clip
InputRaster中选择被裁剪的栅格数据,设定好矩形四个顶点即可
3、在SpatialAnalystTools中提供了多种对栅格数据的提取方法,Arctoolbox中,SpatialAnalyst
Tools>extraction包括提取值到点,根据属性提取,用圆提取,用多边形提取,用掩模提取,用点提取,用矩形提取等,其中的用掩模提取功能可以让我们通过不规则边界来获取需要的栅格数据。

 

可以先建一个polygon的图层,再用这个图层clip那个raster

 

加载空间分析模块,

option选项中设置mask图层,范围,cell尺寸,

用其栅格计算器计算:

 

图层名.shape*1,

点击evaluation,

ok

 

如果不要求一定要多变形裁剪的话,建议使用clip
data management toolbox---clip
这个工具可以保持原有像元信息,但是这里arcmap只提供了矩形切割。
这个约束应该不会影响一般的应用,否则的话建议使用图像处理软件中的mask裁剪。

另外上面大家说得mask什么的方法,只能出来灰度图,可能原先是设计成处理grid的数据吧

 

 

 

 

 

(2)
用任意多边形剪切栅格数据(矢量数据转换为栅格数据)
2.1在ArcCatlog下新建一个要素类(要素类型为:多边形),命名为:ClipPoly.shp
2.2在ArcMap中,加载栅格数据:例如 kunming.img、和ClipPoly.shp
2.3打开 编辑器 工具栏,开始编辑 ClipPoly,根据要剪切的区域,绘制一个任意形状的多边形。打开属性表,修改多边形的字段“ID”的值为1,保存修改,停止编辑。
2.4打开 空间分析 工具栏  
执行命令:<空间分析>-<转换>--<要素到栅格>
指定栅格大小:查询要剪切的栅格图层kunming的栅格大小,这里假设指定为1
指定输出栅格的名称为路径
2.5执行命令:<空间分析>-<栅格计算器>
2.6构造表达式:[kunming]*[polyClip4-polyclip4] ,执行 栅格图层:kunming和 用以剪切的栅格polyClip4 之间的 相乘运算

两种方法差不多,第一种可能更好些,第二种是自己发现的虽然不怎么好 但也分享下,希望有用 呵呵

 

(1)
是否需要裁剪栅格图象区域通过一个面状的shapefile表达出来?
如果可以,那么就很简单了。
在ArcMap中,调用空间分析扩展模块,将你感兴趣区的shapefile多边形图层设置为掩膜,然后在栅格计算器中重新计算一下你的图象,它就会沿掩膜裁出。
 
设置掩膜:空间分析工具条的下拉菜单>option里面设置
 
(2)
用任意多边形剪切栅格数据(矢量数据转换为栅格数据)
2.1在ArcCatlog下新建一个要素类(要素类型为:多边形),命名为:ClipPoly.shp
2.2在ArcMap中,加载栅格数据:例如 kunming.img、和ClipPoly.shp
2.3打开 编辑器 工具栏,开始编辑 ClipPoly,根据要剪切的区域,绘制一个任意形状的多边形。打开属性表,修改多边形的字段“ID”的值为1,保存修改,停止编辑。
2.4打开 空间分析 工具栏  
执行命令:<空间分析>-<转换>--<要素到栅格>
指定栅格大小:查询要剪切的栅格图层kunming的栅格大小,这里假设指定为1
指定输出栅格的名称为路径
2.5执行命令:<空间分析>-<栅格计算器>
2.6构造表达式:[kunming]*[polyClip4-polyclip4] ,执行 栅格图层:kunming和 用以剪切的栅格polyClip4 之间的 相乘运算

 

文章二、

 使用ArcGIS的Raster Caclutaor剪切栅格文件

如果我们需要把一个栅格文件(可以是tif、grid等arcgis所能识别的)的一部分特定感兴趣区截取出来,而且是任意形状的那种,就可以使用arcgis的RasterCaclutaor功能实现。利用RasterCaclutaor功能我们也可以把某个栅格图像与某一个矢量文件的相重叠部分单独切出来。两者的步骤基本一致,都是需要把矢量文件先转成栅格格式,然后利用进行象元间的加减乘除操作。
步骤:
1.  将矢量文件和栅格文件同时添加到arcmap当中。
2.  先将矢量文件转为栅格文件” polygonRaster -polygonraster”
Spatial analysis工具条下的convert, Features to Raster
3. Spatial analysis工具条打开Raster Caclutaor,在计算框内输入:
[Topo.sid] - [polygonRaster - polygonraster]。
 
Tips:这里采用的是两图层相剪操作,是因为polygonRaster –polygonrasterd栅格文件的Value为0,这样两图层象素间Value值对应相减,得到的是Topo.sid的Value值。
如果说polygonRaster –polygonrasterd的value值为1.为了获得Topo.sid的value值则应该选择两图层象素值相乘操作。
有时候这样的图层相剪操作会不成功,提示“Error:  Failed to evaluate thecalculatorexpression”。目前我还不太清楚具体原因是什么,在ESRI支持中心找到一篇文章,提到了可能的原因(语法错误、像元大小不一致、大小写不一致等)
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=18406
 
The error message "Failed to evaluate the calculator equation"appears after clicking Evaluate on the Raster Calculator dialogbox.
Cause
There are several causes for this problem:
• You have a syntax error in the calculator expression.
• The extent and cell size of your input raster is different thanthe extent set for your analysis results.
• The expression will not be evaluated if there are carriagereturns before or after the expression.
• The Raster Calculator is case sensitive.
• There are too many open grids. There is a limit of 50 openrasters of the grid format at any one time.
Solution or Workaround
Some of these issues have been addressed in ArcGIS Version8.1.2.

The corresponding workarounds for the above causes are:
Check your syntax. Type Map Algebra in the index of the online Helpsystem for information on Map Algebra and its syntax.
Make sure the extent and cell size of your analysis result is setappropriately in the Extent and cell size tabs of the Optionsdialog box. The extent of your analysis results should be set thesame as, or encompass, the extent of the layer you are using in theRaster Calculator.
Do not use carriage returns in your expression. Allow theexpression to word-wrap if it is lengthy.
This problem has been resolved in ArcGIS 8.1.2.
Make sure the layer name typed into the expression box case-matchesthe name of the layer in the Layers list. For example:
Layer name: Elevation
Expression typed: slope([elevation])
This expression will not work. The first letter of "elevation"should be capitalized.
This problem has been resolved in ArcGIS 8.1.2.
Remove any un-needed grids from the ArcMap Table of Contents. Thetotal number of open grids, including the one being created by theSpatial Analyst function, cannot exceed 50.
This limit does not apply to non-grid rasters. A workaround is toconvert grids to rasters in ArcCatalog with the Export> Raster To Different Format option

  • 8
    点赞
  • 50
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值