Python – Geographical Data

Python – Geographical Data

Python – Geographical Data

Many open source python libraries now have been created to represent the geographical maps. They are highly customizable and offer a varierty of maps depicting areas in different shapes and colours.
One such package is Cartopy. You can download and install this package in your local environment from Cartopy.
You can find numerous examples in its gallery.
In the below example we show a portion of the world map showing parts of Asia and Australia. You can adjust the values of the parameters in the method set_extent to locate
different areas of world map.

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
figure = plt.figure(figsize=(15, 10))
axis = figure.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())
# make the map global rather than have it zoom in to
# the extents of any plotted data
axis.set_extent((60, 150, 55, -25))
axis.stock_img()
axis.coastlines()
axis.tissot(facecolor='purple', alpha=0.8)
plt.show()

Its output is as follows −

Python – Time Series (Prev Lesson)
(Next Lesson) Python – Graph Data
', { 'anonymize_ip': true });