Python地理数据处理 十九:arcpy批量处理数据之多值提取至点

1. 原理:

Python地理数据处理 十九:arcpy批量处理数据之多值提取至点_第1张图片
Arcmap中的操作:
Python地理数据处理 十九:arcpy批量处理数据之多值提取至点_第2张图片
arcpy实现:

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
arcpy.env.workspace = r"D:/geoDetector/1000mX" #栅格路径
# Set local variables
inPointFeatures = "D:/geoDetector/采样点/采样点_5千.shp" #shp文件路径及名称
inRasterList = arcpy.ListRasters("*", "tif")
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute ExtractValuesToPoints
ExtractMultiValuesToPoints(inPointFeatures, inRasterList, "NONE")
print("finish!")

结果显示:

Python地理数据处理 十九:arcpy批量处理数据之多值提取至点_第3张图片
速度非常快。

2、将多个栅格的像元值提取到 shapefile 点要素类的属性中

import arcpy
from arcpy.sa import *
from arcpy import env 
env.workspace = "c:/sapyexamples/data"
ExtractMultiValuesToPoints("observers.shp", [["elevation", "ELEV"], 
                           ["costraster", "COST"], ["flowdir", "DIR"]], "NONE")

3、使用插值法将多个栅格的像元值提取到 shapefile 点要素类的属性中

# Name: ExtractMultiValuesToPoints_Ex_02.py
# Description: Extracts the cells of multiple rasters as attributes in
#    an output point feature class.  This example takes a multiband IMG
#    and two GRID files as input.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inPointFeatures = "poi.shp"
inRasterList = [["doqq.img", "doqqval"], ["redstd", "focalstd"], 
                ["redmin", "focalmin"]]

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute ExtractValuesToPoints
ExtractMultiValuesToPoints(inPointFeatures, inRasterList, "BILINEAR")

你可能感兴趣的:(Python,python,arcgis,开发语言,算法)