ArcGIS Python implements batch raster data renaming

Source: Internet
Author: User

One, the code

[Python]View Plaincopyprint?
  1. Import arcpy
  2. Arcpy.env.workspace = "f:\\ndvi\\"
  3. Rasters = arcpy. Listrasters ("*","grid")
  4. for Raster inch rasters:
  5. Rename="re_"+raster
  6. arcpy. Rename_management (Raster, Rename, "Rasterdataset")
  7. Print (raster+"---->"+rename)
  8. Print ("All Done")
Import arcpyarcpy.env.workspace = "f:\\ndvi\\" rasters = arcpy. Listrasters ("*", "grid") for raster in rasters:    rename= "re_" +raster    arcpy. Rename_management (Raster, Rename, "Rasterdataset") print (    raster+ "---->" +rename) print ("All done")

Ii. description

1. This processing is raster data and can also be used to process vector (shapefiles) and text files ( textfile)

2. Do not change the format of the data;

3. Can only be renamed on the basis of the original data, cannot generate new files.

Third, the operation

ArcGIS Python implements batch raster data renaming

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.