#计算多阶邻接度指数 import numpy as np from osgeo import gdal import matplotlibpyplot as plt from tqdm import trange #Definition function converts raster data to a binary matrix def read_img_datafilename
This is a Python script for calculating the Multi-order Adjacent order index (MAI) of urban construction land using raster data. The script uses the GDAL library to read and write raster data, and numpy and matplotlib for data processing and visualization.
The script defines several functions for reading and writing raster data, as well as for calculating the MAI. The MAI calculation involves creating a multi-level buffer zone around each pixel of new urban construction land, and counting the number of pixels of original urban construction land within the buffer zone. The MAI value is then calculated using a formula that takes into account the area of the buffer zone and the area of original urban construction land within it.
The script takes as input the paths to the raster data files for the original and new urban construction land, and a list of file names for the new urban construction land data for each time period. It then loops over each time period, calculates the MAI for the corresponding new urban construction land raster data, and writes the MAI raster data to a new file.
Overall, this script provides a useful tool for analyzing urban growth and development patterns over time, and could be used in a variety of applications, such as urban planning and land management.
原文地址: https://www.cveoy.top/t/topic/boUV 著作权归作者所有。请勿转载和采集!