Dealing with geospatial data is often seen as cumbersome in the data science world. We seldom bother to include spatial features in our machine learning models. It is partly due to the complexity of Geometries and Geographic coordinate reference systems. However, I tend to get a boost in my machine learning models and better insights incorporating spatial features.

During the past month, I have been sharing Geospatial tips and tricks in Python on Twitter, and It has received a lot of attention from the Geospatial community.

In this article, I will share the first five tips and tricks of dealing with Geospatial data with Geopandas. I used a code beautifier online tool to display the code.

Tip #1: Read Geospatial data directly under a zipped folder

We compress our data to reduce space and transfer quickly. Therefore, we often tend to unzip or decompress it before reading the data. However, that is not necessary. With Geopandas, you can read zipped files directly, like this.

Image for post

Reading Geographic data zip files.

This technique also works with subfolders in a zip file. You just need to point it to the subfolder.

#data-science #education #python #spatial #towards-data-science

5 Geospatial Tips and Tricks in Python
1.40 GEEK