Chicago01: Analysis of urban spatial structure_Edge_Physics

Jingyi Chen
3 min readDec 11, 2020

--

This experiment group chooses Chicago as the object of urban spatial structure analysis, the analysis content involved will be more systematic and rich, some code functions directly use the previous research results, and constantly add new research content. The urban structure of Chicago is significantly different from that of domestic cities. In the specific analysis, the differences will be identified, especially the comparison of analysis results will further determine the similarities and differences between them. This experiment is expected to involve a lot of content, I select a few parts of the period that I am more interested in to share with you.

Chicago01_Analysis of urban spatial structure_ Edge_ Physics

Chicago_SDAM_basis.py

1 Basic: class baseClass

  1. Configure the working environment: def filepath (self, dirpath, filetype)
  2. Take the folder name as the key, and the value is the list containing all the file names under the folder. The file type can be defined by itself: def filepath (self, dirpath, filetype):
  3. Read Landsat*_ MTL.txt File, extract the required information: def MTL_ info(self):
  4. Raster data reading program,. TIF, single band. Read the required band data and store it. Methods: def singleband (self, rasterfp) was used
  5. Image data cutting: def rasterclip (self, rasterfp, cliprange): def rasterclip (self, rasterfp, cliprange)
  6. Save raster data, 1 band: def rasterrw (self, rastervalue, resultspath, rastersavingfn, para)
  7. Display the data in the program of “show self”
  8. Display of calculated data (array): def arrayshow (self, data): 1
  9. Display image: def imgshow (self, imges, titlename, xyticksrange = false)
  10. Load numpy array data. This function can be omitted and called directly np.load () method: def nparrayload (self, dataloadfn)
  11. Read multiple numpy array data and append it to an array: def npyread (self, filepath): -
  12. Read numpy array data. Because each array has different shapes, it is finally appended to a list: def npyreadmulti (self, filepath):

2 class calculate

  1. Adjust the classification data and merge summer and autumn farmland areas: def classification adjust (self, Cl_ a,cl_ B):
  2. Methods of grid clustering: def rastercluster (self, rasterarray, Val, EPS, modelload =):
  3. The inflection point of knee / infection points: def Linegraph (self, x, y):
  4. Statistics of box chart: def boxplot (self, data, labels):

3 class combo

  1. Set the cluster distance, calculate the cluster in batches, and save the raster file and array array: def clusterbundlecal (self, epslist): the cluster distance is set, and the cluster is calculated in batches
  2. Batch chart statistics: def graph analysis (self):
  3. The maximum cluster is extracted and stored as raster: def maxclusterraster (self, clusterarray, clusterfrequency):
  4. Write the largest cluster change area into raster: def clustermaxvariaton (self, clusterarray, clusterfrequency):

Cluster construction land

DBSCAN distance clustering method is the same as POI clustering method of life circle analysis. But POI is point data, this experiment also aims to complete the clustering implementation based on raster raster data. Because the high altitude resolution of ladsat 8 image data is 30m (which can be increased from pan to 15m), the step size of clustering distance is set to 30m, and the clustering results are as follows:

In the further analysis, the largest cluster region, i.e. built-up area, is extracted to facilitate observation. One way is to directly extract the maximum cluster area of each level; the other is to further observe the changes between the two levels, and set the upper built-up area value as 1 and the lower layer as 2 to do and process. Then the final value may be 0,1,2,3. 0 means that there is no value in both layers, 1 represents that only the upper layer has value, 2 represents that only the lower layer has value, and 3 represents that both layers have values. The results are as follows:

--

--