From the course: Data Science Foundations: Python Scientific Stack [CoderPad]
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Using geospatial data with shapely - Python Tutorial
From the course: Data Science Foundations: Python Scientific Stack [CoderPad]
Using geospatial data with shapely
- [Instructor] Sometimes we'd like to do more than just draw points on a map. For example, you might like to know if a location, a point, is inside the city limit. Cities are represented as polygon. And the question maps to, is this point inside that polygon? There are several libraries in Python to work with what is called GIS, Geographic Information System and geometry in general. We are going to have a look at one library called Shapely. The two main data structures that we're going to use are a point and a polygon. So from shapely geometry, import point and we are going to create a point and show it. And the interactive prompt is showing the point as, well, a point. But you can ask the point, what is the dot X and the dot Y of the point? Now let's take a look at the Polygon. So input the Polygon and create it. And when we run it, again, the interactive prompt is going to show us a square because this is the Polygon.…