arcgis关键点提取
时间: 2023-11-02 14:06:49 浏览: 162
在ArcGIS中,可以使用ArcCatalog、ArcMap和ArcToolbox来实现关键点提取。这三个组件是构成完整GIS的关键内容。
在脚本文件中,可以使用以下代码来实现关键点提取:
```
import arcpy
from arcpy import env
from arcpy.sa import *
point = arcpy.GetParameterAsText(0) # 用于提取点的shp
inputwork = arcpy.GetParameterAsText(1) # 输入的要提取点的数据
workPath = arcpy.GetParameterAsText(2) # 输出的位置
arcpy.env.workspace = inputwork
rasters = arcpy.ListRasters("*", "tif")
for raster in rasters:
outPath = workPath + "\\" + str(raster).replace('.tif','') + ".shp"
ExtractValuesToPoints(point, raster, outPath)
```
另外,也可以直接使用Python的arcpy环境或ARCGIS内置代码编辑器来实现关键点提取,代码如下:
```
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("spatial")
arcpy.gp.overwriteOutput = 1
arcpy.env.workspace = r"G:\PRE2007/" #环境
outpath = r"G:\site\POINT_PRE2007/" #存储
inMask = r"G:\site\site.shp" #需提取shp点
rasters = arcpy.ListRasters("*", "tif")
for raster in rasters:
outPath = outpath + "\\" + str(raster).replace('.tif','') + ".shp"
ExtractValuesToPoints(inMask, raster, outPath)
print("All project is OK")
```
这些代码可以将栅格数据中的值提取到点图层中,实现关键点的提取操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [ArcGIS培训教程.pdf](https://download.csdn.net/download/qq_43934844/87344111)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [代码分享 | Arcgis批量栅格值提取至点(自定义工具箱或代码)](https://blog.csdn.net/weixin_42776126/article/details/124651980)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文