- Practical GIS
- Gábor Farkas
- 426字
- 2021-07-02 22:49:14
Opening tabular layers
The vector layers we opened so far were dedicated vector data exchange formats; therefore, they had every information coded in them needed for QGIS to open them. There are some cases when we get some data in a tabular format, like in a spreadsheet. These data usually contain points as coordinates in columns and attributes in other columns. They do not store any metadata about the vectors, which we have to gather from readme files, or the team members producing the data.
QGIS can handle one tabular format--CSV (Comma Separated Values), which is an ASCII file format, a simple text file containing tabular data. Every row is in a new line, while fields are separated with an arbitrary field separator character (the default one is the comma). The layout of such a layer is custom; therefore, we need to supply the required information about the table to QGIS. If we try to drag our GeoNames layer to the canvas, QGIS yields to a Layer is not valid error. To open these files, we need to use the Add Delimited Text Layer tool from the sidebar (comma icon):

If we browse our GeoNames table, we can see that QGIS automatically creates a preview from the accessed data. We can also see that the preview is far from correct. It's time to consult the readme file coming with the GeoNames extract. In the first few lines, we can see the most important information--The data format is tab-delimited text in utf8 encoding. Let's select Custom delimiters and check Tab as a delimiter. Now we only need to supply the columns containing the coordinates. We can see there are no headers in the data. However, as the column descriptions are ordered in the readme file, we can conclude that the fifth column contains the latitude data (Y field), while the sixth column contains the longitude data (X field). This is the minimum information we can add the layer with:

- Android Wearable Programming
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- C語言程序設計(第3版)
- 自制編譯器
- PHP+MySQL+Dreamweaver動態網站開發實例教程
- Mastering Python Networking
- Oracle Exadata專家手冊
- Mastering C++ Multithreading
- 細說Python編程:從入門到科學計算
- 編程改變生活:用Python提升你的能力(進階篇·微課視頻版)
- Java Web開發實例大全(基礎卷) (軟件工程師開發大系)
- ASP.NET求職寶典
- UI設計基礎培訓教程(全彩版)
- 大規模語言模型開發基礎與實踐
- ROS機器人編程實戰