Geo Visualization Of Spatial Data Using Python

Using techniques of geovisualization, GIS provides a far richer and more flexible medium for portraying attribute distributions than the paper mapping.

This documentation is all about the visualisation of geo spatial data of Visakhapatnam city.

First of all,let us display Visakhapatnam Boundary map with wards.

Ward-wise map:

In [68]:
import pandas as pd
import geopandas as gpd

import matplotlib.pyplot as plt

pd.options.display.max_rows = 10
In [2]:
import io
ward_map = geopandas.read_file('/Users/navjoth/Downloads/Ward_Boundary.shp')
In [3]:
ward_map.plot(figsize=(9,9))
Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x11bad23c8>

Bar graph representation of Ward Areas:

In [13]:
ward_map['SHAPE_Area'].plot(kind='bar',color="blue",figsize=(20, 8),width=1,align='center')
plt.title('Wards Area representation')
plt.xlabel('Ward Numbers ')
plt.ylabel('Area in msq')
Out[13]:
Text(0, 0.5, 'Area in msq')

Land Use of Visakhapatnam:

Built Up Areas like commercial,residential,Industrial,etc areas comes under Land use .

Lets visualize those data.

Commercial Areas:

In [62]:
import io
commercial_area = geopandas.read_file('/Users/navjoth/Downloads/geovisual/boundry_line.shp')
commercial_area1 = geopandas.read_file('/Users/navjoth/Downloads/geovisual/Commercial.shp')
In [91]:
df = pd.DataFrame(commercial_area1,columns=['Class','Name','Area']).head()
print(df)

#commercial_area1.loc[0, 'geometry']
        Class                                               Name          Area
0  Commercial                                               None    754.507274
1  Commercial                          TEJA UPPER PRIMARY SCHOOL   2753.381737
2  Commercial  SAI BABA TEMPLE BY JONNALAGADDA ACHYUTANANDA\n...   4269.870076
3  Commercial                                 SIVASHIVANI SCHOOL  12177.448260
4  Commercial                              ZPH SCHOOOL ISLAMPETA    808.349293

Map of commercial areas:

In [81]:
commercial_area1.plot(figsize=(8,9))
Out[81]:
<matplotlib.axes._subplots.AxesSubplot at 0x11fea7710>

Statistical data representation of commercial areas:

In [8]:
commercial_area['Density'].value_counts().plot(kind='pie',
                            figsize=(5, 6),
                            autopct='%1.1f%%',
                            startangle=90,  
                            shadow=True,           
                            )
plt.title('Density of the commercial areas')
plt.axis('equal') 
plt.show()

Industrial Areas:

In [9]:
import io
industrial_area = geopandas.read_file('/Users/navjoth/Downloads/Industry.shp')
In [93]:
df = pd.DataFrame(industrial_area,columns=['Class','Name','Area'])
print(df)
          Class                           Name          Area
0    Industrial                           None  6.669125e+02
1    Industrial                           None  2.103397e+03
2    Industrial            HINDUJA POWER PLANT  2.762801e+06
3    Industrial                           None  6.910745e+03
4    Industrial                           None  4.075001e+04
..          ...                            ...           ...
450  Industrial  SRI RAM SAW MILLSTIMBER DEPOT  2.062822e-01
451  Industrial  SRI RAM SAW MILLSTIMBER DEPOT  3.022030e+01
452  Industrial  SRI RAM SAW MILLSTIMBER DEPOT  7.855829e+01
453  Industrial         PRIYA BRICK INDUSTRIES  6.561368e+01
454  Industrial                           None  6.561368e+01

[455 rows x 3 columns]
In [78]:
industrial_area.plot(figsize=(12,12),color="darkblue")
#commercial_area.loc[0, 'geometry']
Out[78]:
<matplotlib.axes._subplots.AxesSubplot at 0x1200d1940>

Map which shows all commercial,industrial,residential areas:

In [110]:
import io
resi_area = geopandas.read_file('/Users/navjoth/Downloads/geovisual/builtup.shp')
resi_area.plot(figsize=(22,22),color="darkblue")
Out[110]:
<matplotlib.axes._subplots.AxesSubplot at 0x13f76f7b8>
In [111]:
df = pd.DataFrame(resi_area,columns=['Class','Name','Area'])
print(df)
              Class                       Name          Area
0        Commercial                       None    754.507274
1        Commercial  TEJA UPPER PRIMARY SCHOOL   2753.381737
2        Commercial         SIVASHIVANI SCHOOL  12177.448260
3        Commercial      ZPH SCHOOOL ISLAMPETA    808.349293
4        Commercial                       None   6044.252531
...             ...                        ...           ...
248684  Residential                       None      1.971668
248685  Residential                       None      1.971668
248686  Residential                       None      0.011935
248687  Residential                       None      0.011935
248688  Residential                       None     65.613681

[248689 rows x 3 columns]

Bar graph representation of commercial,industrial,residential areas:

In [119]:
resi_area['Class'].value_counts().plot(kind='bar',color="yellow",figsize=(16, 6),align='center')
plt.title('Types of Built up Areas')
plt.xlabel('Builtup Type ')
plt.ylabel('Area in msq')
Out[119]:
Text(0, 0.5, 'Area in msq')

Zonewise distribution of builtup areas:

In [123]:
resi_area['ZONE'].value_counts().plot(kind='pie',
                            figsize=(5, 6),
                            autopct='%1.1f%%',
                            startangle=90,  
                            shadow=True,           
                            )
plt.title('Zonewise distribution of builtup')
plt.axis('equal') 
plt.show()

Thus from the above visualisation,we can conlclude that most of the builtup area occupied by residential land only.From the above piechart we can see maximum part of builtup comes in Zone 5.