Hello,
In this post, we'll delve into the most fundamental aspect of file conversion, even among the basics.
Fundamentally, vector files and raster files can be converted between each other, allowing rasterization (vector to raster) and polygonization (raster to vector).
Often in GIS tasks, there are functionalities that can only be applied to vector layers, and conversely, there are functionalities that only work on raster layers. In such cases, the rasterize and polygonize functions can be quite useful.
However, for large files with a lot of information, conversion can take a considerable amount of time and may even cause lag in the software, so blindly converting file extensions may not always be the most efficient choice.
Usually, spatial boundary maps, including administrative boundaries, are available in vector files. If you have a raster file for administrative boundary maps instead of a shapefile, applying styles and visualizing the map itself may not be a problem.
However, it could become problematic if you need to use functionalities like Zonal Statistics (for more details, refer to the following link: https://qgis-jaehee.tistory.com/16), which requires spatial information to be in vector layers.
The Zonal Statistics function can only be utilized when spatial information is in vector layers.
Now, let's take a concrete look at how to convert between vector and raster files through the example below.
First, let's download the administrative boundary map of Papua New Guinea from the website below, which provides border data in tif format:
https://hub.worldpop.org/geodata/summary?id=24680
Please drop the downloaded file onto the QGIS main screen.
You can confirm that a faint map has been imported, as shown below.
Now, from the top menu bar, navigate to Raster > Conversion > Polygonize (Raster to Vector).
When the window pops up, select the Input layer as png_subnational_admin_2000_2020, then click the "Run" button.
It takes quite a bit of time to convert even for small countries.
I remember leaving the program running overnight when working on the entire East Asian region.
After waiting for a few minutes and closing the completion message window, you'll find a new layer named "Vectorized" has been added, as shown below.
The raster file has been converted to a vector file.
In the next post, we'll explore the method of "Raster to Vector" conversion.
Thank you!
'English Guidance > QGIS Basics' 카테고리의 다른 글
[QGIS Basics] Adding Labels for each Field (0) | 2024.04.12 |
---|---|
[QGIS Basics] Refactor Fields - Changing the Field Type (0) | 2024.04.04 |
[QGIS Basics] Playing around with Legend (0) | 2024.03.30 |
[QGIS Basics] Playing around with Symbology (0) | 2024.03.27 |
[QGIS Basics] GIS File Extensions, GIS File Importing (0) | 2024.03.25 |
댓글