In this tutorial, you will learn how you can use a simple python script to extract data from a raster.
Extracting pixel values at point locations can easily be done using a dedicated GIS software package such as QGIS or ArcGIS, if you are doing it just for a limited number of points. However, if you were to do the same for a large number of points, this exercise can get quite tedious, repetitive and extremely challenging.
In this tutorial, we are discussing a way of doing this in just a matter of few seconds using a small Python script, regardless of how large the dataset is. To demonstrate this, we are making use of a point shapefile, which indicates a number of selected cities across the United States. Along with that, we are using a raster dataset which shows the average temperature variation across the country at a selected day in November 2021.
The two major Python libraries that are being incorporated in this tutorial are GeoPandas and Rasterio. With the help of these two libraries, we manage to extract the point coordinates in the form of Latitude and Longitude values at each point location (city), and extract the corresponding temperature value (pixel value) from the raster for each of the aforementioned points. Finally, we write the information to a Pandas DataFrame and export it as a separate CSV file using the Pandas library.
Auf dieser Seite können Sie das Online-Video Automating Raster Data Extraction using Python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Gis and Rs tools on different software 27 Februar 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 66 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!