Spatial data is the data that identifies the geographic location of features and boundaries on Earth, such as lake, stream, oceans, bridges, and more manmade and natural features.
To read this data, we can use either Jupyter notebook, google colab. First, it requires the installation of geopandas. To install GeoPandas, you need to make sure that all dependencies are installed correctly. These dependencies include Fiona, pyproj, rtree, shapely. Download the file of all these dependencies from this link-https://www.lfd.uci.edu/~gohlke/pythonlibs/. After this, run all these codes given below in anaconda prompt.
pip install "path of all dependencies"
pip install geopandas.
Now import geopandas and other library to read the file
import pandas as pd
import geopandas as gpd
from shapely.geometry import point
%matplotlib inline
For reading the file, use the read_file function of geopandas as follow.
gdf = geopandas.read_file('filename')
Using .head function of geopandas , we can print the first 10 rows of the file in the same way as we can do with panda library
gdf.head()
Geopandas makes it easy to create maps. It is as easy as using the plot method. These maps help in predicting high population area, change of factors such as wind, rains. With the help of geopandas we can see how temperature is changing in upper and lower hemisphere of the map.
gdf.plot()
Geopandas allow spatial operation on geometric types, whereas pandas do not.It combines the capability of pandas and shapely. Geopandas supports geocoding , it converts place names to a location on Earth. It is done using the following commands.
abc_locations = gpd.tools.geocode('abc.AbcName')
Spatial database provides a strong database for accessing, storing and managing continuous data. To read and analyze all this information geopandas and python makes it easy.
Σχόλια