From the course: Advanced Geospatial Data Analytics in Python
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Turning the raster data into a vector grid - Python Tutorial
From the course: Advanced Geospatial Data Analytics in Python
Turning the raster data into a vector grid
- [Instructor] Now, that we have a proven methodology for downsampling raster data, let's get back to the main question and see how we can turn raster data into vector data. Remember, the downsampling methodology takes a sample fraction and then computes a thread perimeter to extract the row and column indices of each pixel that we are going to keep after the filtering. So to turn the raster data into a vector grid, let's start from the subsampling part. So this part we have already done before. Here, if you read the raster grid, create a mask and do the subsampling. Then with the next line of code, we are going to extract the X and Y coordinates of every sample row, which is bringing us one step closer to the final part where we are going to build a GeoDataFrame containing point geometries of these coordinates. With other words, once we have the rows and columns each containing the corresponding coordinates of the certain location, we just need to write a python loop and call the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.