How does Python calculate volume ratio and building density
This article mainly explains the "Python how to calculate the volume ratio and building density", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Python how to calculate the volume ratio and building density" bar!
First, the area is calculated in ArcGIS, the dbf table is exported, and the data are processed and visualized in Python.
Data processing read data from dbfread import DBF import pandas as pd # # read dbf table table = DBF ("summary table .dbf", encoding= "utf8") data = pd.DataFrame (table) data.head () data cleaning data.rename (columns= {'parcel surface': 'parcel area', 'layers':' floor', 'gross building area': 'gross building area', 'base surface': 'base area'} Inplace = True) data = data.drop (labels= ["OBJECTID", "Shape_Leng", "Shape_Area", "floor"], axis=1) data = data [["parcel name", "base area", "gross building area", "parcel area"]] data.head () data perspective pivot1 = pd.pivot_table (data,index= ["parcel name"], values= ["base area", "gross building area",] Aggfunc=sum) pivot2 = pd.pivot_table (data,index= ["parcel name"], values= ["parcel area",], aggfunc=max) pivot = pd.merge (pivot1, pivot2, on= "parcel name") pivot calculated volume ratio and building density pivot ["building density"] = pivot ["base area"] / pivot ["parcel area"] pivot ["volume ratio"] = pivot ["total building area"] / pivot ["parcel area"] pivot result
Data visualization data reading import geopandas as gpdimport matplotlib.pyplot as pltregibns = gpd.GeoDataFrame.from_file ('MyProject.gdb',layer=' parcel') regibns.plot () data connection reg = pd.merge (regibns, pivot, left_on=' parcel name', right_on=' parcel name') reg graded color map reg.plot (figsize= (12,12), column=' plot ratio', scheme='quantiles', legend=True, cmap='Reds', edgecolor='k',) Land Development intensity Map
Thank you for reading, the above is the content of "how Python calculates volume ratio and building density". After the study of this article, I believe you have a deeper understanding of how Python calculates volume ratio and building density, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!