ARCGIS uses vector data to clip raster data (the output range is set to the range of the raster + batch clipping)

0 Premise: Try to keep the geographic coordinate system of raster data and vector data consistent, if not, use

Data Management Tools–Projections and Transformations–Project for coordinate system conversion

insert image description here

1 specific process

My data includes a raster data and shp data of Chinese administrative regions
insert image description here

在 Data Management Tools–Raster–Raster Pcocessing–Clip

insert image description here
Notice:

  • Selection of the latitude and longitude range of Rectangle

The clipping results are as follows: the range of the final result is the latitude and longitude range of the raster
The purpose of my clip is to turn the data outside the shp boundary in the grid into Nan, so as to facilitate subsequent drawing

2 batch cropping

Here, I am using ArcGIS's ModelBuilder

  1. Click on the following
    insert image description here
    insert image description here
  2. Insert an iterator
    insert image description here
    insert image description here
    Select the file directory in the Workspace Catalog
    insert image description here
    Click Iterate Rasters, set the Raster Format to tif
    insert image description here
    Name No need to change here Right click
    on Iterate Rasters
    insert image description here
  3. Click Add to add the Clip tool.
    insert image description here
    Right-click Clip to set the parameters, and select all we need.
    insert image description here
    These two are optional boxes on the original tool (both selected)
    insert image description here
    Output Extent is the location of the shp file
    insert image description here
  4. Input the Raster into the Clip, click the Clip tool, and set the corresponding parameters. After
    insert image description here
    setting the output file name of the Clip, in order to ensure the correspondence with the input data, it can be set to %Name%
    (this Name corresponds to the previous Name)
    insert image description here
  5. Verify and run the model
    insert image description here
    If there is no problem, run it! ! Finish! ! !
    Learning link:

Guess you like

Origin blog.csdn.net/weixin_45913084/article/details/130555673