官术网_书友最值得收藏!

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:

If you have many layers, giving them talkative names can aid you in your work. You can rename a layer by right-clicking on it in the Layers Panel and selecting Rename. If you have difficulties with rendering the number of points in the GeoNames extract, you can check out the Render option on the status bar, load the layer, check out its visibility in the Layers Panel, then check in Render again. This might make no sense at this point but it will come in handy later.
主站蜘蛛池模板: 读书| 景德镇市| 高阳县| 贵定县| 南和县| 永修县| 漳平市| 临沂市| 河北区| 东光县| 蒲城县| 湖口县| 冀州市| 和静县| 金沙县| 扎鲁特旗| 涪陵区| 陇南市| 龙井市| 武穴市| 定西市| 东兴市| 南开区| 吉首市| 若羌县| 新竹市| 行唐县| 乌兰县| 甘谷县| 民丰县| 九龙县| 绿春县| 安康市| 都兰县| 秭归县| 牡丹江市| 甘洛县| 黑山县| 甘肃省| 泗阳县| 宝清县|