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

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.
主站蜘蛛池模板: 梨树县| 中西区| 株洲市| 高邑县| 永定县| 东阳市| 如皋市| 承德县| 襄樊市| 禹城市| 泸西县| 砀山县| 娱乐| 徐州市| 汉寿县| 定边县| 阿荣旗| 浑源县| 瓦房店市| 齐齐哈尔市| 从江县| 六盘水市| 阜阳市| 承德县| 昌图县| 策勒县| 镇康县| 乌海市| 韩城市| 江北区| 澳门| 门头沟区| 英吉沙县| 凌源市| 绥化市| 宁南县| 乐都县| 于都县| 广宁县| 丽江市| 芷江|